File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11# Test the windows specific win32reg module.
22# Only win32reg functions not hit here: FlushKey, LoadKey and SaveKey
33
4- import os , sys
4+ import os , sys , errno
55import unittest
66from test import support
77threading = support .import_module ("threading" )
@@ -289,11 +289,16 @@ def test_long_key(self):
289289 DeleteKey (HKEY_CURRENT_USER , '\\ ' .join ((test_key_name , name )))
290290 DeleteKey (HKEY_CURRENT_USER , test_key_name )
291291
292- @unittest .skipUnless ('PROMPT' in os .environ , "Requires interactive session" )
293292 def test_dynamic_key (self ):
294293 # Issue2810, when the value is dynamically generated, these
295294 # throw "WindowsError: More data is available" in 2.6 and 3.1
296- EnumValue (HKEY_PERFORMANCE_DATA , 0 )
295+ try :
296+ EnumValue (HKEY_PERFORMANCE_DATA , 0 )
297+ except OSError as e :
298+ if e .errno in (errno .EPERM , errno .EACCES ):
299+ self .skipTest ("access denied to registry key "
300+ "(are you running in a non-interactive session?)" )
301+ raise
297302 QueryValueEx (HKEY_PERFORMANCE_DATA , "" )
298303
299304 # Reflection requires XP x64/Vista at a minimum. XP doesn't have this stuff
You can’t perform that action at this time.
0 commit comments