We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent ea51e74 commit df3224bCopy full SHA for df3224b
1 file changed
Lib/test/test_winreg.py
@@ -66,23 +66,11 @@ class BaseWinregTests(unittest.TestCase):
66
def setUp(self):
67
# Make sure that the test key is absent when the test
68
# starts.
69
- self.delete_tree(HKEY_CURRENT_USER, test_key_name)
70
-
71
- def delete_tree(self, root, subkey):
72
try:
73
- hkey = OpenKey(root, subkey, 0, KEY_ALL_ACCESS)
+ DeleteTree(HKEY_CURRENT_USER, test_key_name)
74
except OSError:
75
- # subkey does not exist
76
- return
77
- while True:
78
- try:
79
- subsubkey = EnumKey(hkey, 0)
80
- except OSError:
81
- # no more subkeys
82
- break
83
- self.delete_tree(hkey, subsubkey)
84
- CloseKey(hkey)
85
- DeleteKey(root, subkey)
+ # Key doesn't exist, which is fine
+ pass
86
87
def _write_test_data(self, root_key, subkeystr="sub_key",
88
CreateKey=CreateKey):
0 commit comments