#9289: Workaround for test_long_key(test_winreg) failure on Win2000.

RegDeleteKeyA fails with ERROR_MORE_DATA if the length of 2nd
parameter exceeds 260.
This commit is contained in:
Hirokazu Yamamoto 2010-10-22 11:47:07 +00:00
parent f084376f23
commit ecdead62b4
1 changed files with 4 additions and 2 deletions

View File

@ -261,7 +261,8 @@ class LocalWinregTests(BaseWinregTests):
finally:
done = True
thread.join()
DeleteKey(HKEY_CURRENT_USER, test_key_name+'\\changing_value')
with OpenKey(HKEY_CURRENT_USER, test_key_name, 0, KEY_ALL_ACCESS) as key:
DeleteKey(key, 'changing_value')
DeleteKey(HKEY_CURRENT_USER, test_key_name)
def test_long_key(self):
@ -275,7 +276,8 @@ class LocalWinregTests(BaseWinregTests):
num_subkeys, num_values, t = QueryInfoKey(key)
EnumKey(key, 0)
finally:
DeleteKey(HKEY_CURRENT_USER, '\\'.join((test_key_name, name)))
with OpenKey(HKEY_CURRENT_USER, test_key_name, 0, KEY_ALL_ACCESS) as key:
DeleteKey(key, name)
DeleteKey(HKEY_CURRENT_USER, test_key_name)
def test_dynamic_key(self):