diff options
author | Hirokazu Yamamoto <ocean-city@m2.ccsnet.ne.jp> | 2010-10-22 11:47:07 (GMT) |
---|---|---|
committer | Hirokazu Yamamoto <ocean-city@m2.ccsnet.ne.jp> | 2010-10-22 11:47:07 (GMT) |
commit | ecdead62b4d7d6870c16a95f8dfcb40cd16bf516 (patch) | |
tree | d3741032edd7cab2a0451b27249766ea060984e2 | |
parent | f084376f23ee20a972a1fb28f9fd5366f8fd2439 (diff) | |
download | cpython-ecdead62b4d7d6870c16a95f8dfcb40cd16bf516.zip cpython-ecdead62b4d7d6870c16a95f8dfcb40cd16bf516.tar.gz cpython-ecdead62b4d7d6870c16a95f8dfcb40cd16bf516.tar.bz2 |
#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.
-rw-r--r-- | Lib/test/test_winreg.py | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/Lib/test/test_winreg.py b/Lib/test/test_winreg.py index da3a918..ad4cf42 100644 --- a/Lib/test/test_winreg.py +++ b/Lib/test/test_winreg.py @@ -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): |