[Python-checkins] cpython (3.2): Try other approach to fix issue #15334.
antoine.pitrou
python-checkins at python.org
Fri Jul 13 22:51:40 CEST 2012
http://hg.python.org/cpython/rev/dad89e7479e8
changeset: 78091:dad89e7479e8
branch: 3.2
parent: 78087:2f2286c3b4f7
user: Antoine Pitrou <solipsis at pitrou.net>
date: Fri Jul 13 22:46:41 2012 +0200
summary:
Try other approach to fix issue #15334.
files:
Lib/test/test_winreg.py | 11 ++++++++---
1 files changed, 8 insertions(+), 3 deletions(-)
diff --git a/Lib/test/test_winreg.py b/Lib/test/test_winreg.py
--- a/Lib/test/test_winreg.py
+++ b/Lib/test/test_winreg.py
@@ -1,7 +1,7 @@
# Test the windows specific win32reg module.
# Only win32reg functions not hit here: FlushKey, LoadKey and SaveKey
-import os, sys
+import os, sys, errno
import unittest
from test import support
threading = support.import_module("threading")
@@ -289,11 +289,16 @@
DeleteKey(HKEY_CURRENT_USER, '\\'.join((test_key_name, name)))
DeleteKey(HKEY_CURRENT_USER, test_key_name)
- @unittest.skipUnless('PROMPT' in os.environ, "Requires interactive session")
def test_dynamic_key(self):
# Issue2810, when the value is dynamically generated, these
# throw "WindowsError: More data is available" in 2.6 and 3.1
- EnumValue(HKEY_PERFORMANCE_DATA, 0)
+ try:
+ EnumValue(HKEY_PERFORMANCE_DATA, 0)
+ except OSError as e:
+ if e.errno in (errno.EPERM, errno.EACCES):
+ self.skipTest("access denied to registry key "
+ "(are you running in a non-interactive session?)")
+ raise
QueryValueEx(HKEY_PERFORMANCE_DATA, "")
# Reflection requires XP x64/Vista at a minimum. XP doesn't have this stuff
--
Repository URL: http://hg.python.org/cpython
More information about the Python-checkins
mailing list