mirror of
https://github.com/python/cpython.git
synced 2025-11-10 14:31:24 +00:00
Try other approach to fix issue #15334.
This commit is contained in:
parent
924ae1b040
commit
2bb3021837
1 changed files with 8 additions and 3 deletions
|
|
@ -1,7 +1,7 @@
|
||||||
# Test the windows specific win32reg module.
|
# Test the windows specific win32reg module.
|
||||||
# Only win32reg functions not hit here: FlushKey, LoadKey and SaveKey
|
# Only win32reg functions not hit here: FlushKey, LoadKey and SaveKey
|
||||||
|
|
||||||
import os, sys
|
import os, sys, errno
|
||||||
import unittest
|
import unittest
|
||||||
from test import support
|
from test import support
|
||||||
threading = support.import_module("threading")
|
threading = support.import_module("threading")
|
||||||
|
|
@ -289,11 +289,16 @@ class LocalWinregTests(BaseWinregTests):
|
||||||
DeleteKey(HKEY_CURRENT_USER, '\\'.join((test_key_name, name)))
|
DeleteKey(HKEY_CURRENT_USER, '\\'.join((test_key_name, name)))
|
||||||
DeleteKey(HKEY_CURRENT_USER, test_key_name)
|
DeleteKey(HKEY_CURRENT_USER, test_key_name)
|
||||||
|
|
||||||
@unittest.skipUnless('PROMPT' in os.environ, "Requires interactive session")
|
|
||||||
def test_dynamic_key(self):
|
def test_dynamic_key(self):
|
||||||
# Issue2810, when the value is dynamically generated, these
|
# Issue2810, when the value is dynamically generated, these
|
||||||
# throw "WindowsError: More data is available" in 2.6 and 3.1
|
# throw "WindowsError: More data is available" in 2.6 and 3.1
|
||||||
|
try:
|
||||||
EnumValue(HKEY_PERFORMANCE_DATA, 0)
|
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, "")
|
QueryValueEx(HKEY_PERFORMANCE_DATA, "")
|
||||||
|
|
||||||
# Reflection requires XP x64/Vista at a minimum. XP doesn't have this stuff
|
# Reflection requires XP x64/Vista at a minimum. XP doesn't have this stuff
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue