Skip to content

Commit b778030

Browse files
committed
Update document
1 parent 8ef1285 commit b778030

File tree

1 file changed

+21
-0
lines changed

1 file changed

+21
-0
lines changed

Doc/library/winreg.rst

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -173,6 +173,27 @@ This module offers the following functions:
173173
See :ref:`above <exception-changed>`.
174174

175175

176+
.. function:: DeleteTree(key, sub_key=None)
177+
178+
Deletes the specified key and all its subkeys and values recursively.
179+
180+
*key* is an already open key, or one of the predefined
181+
:ref:`HKEY_* constants <hkey-constants>`.
182+
183+
*sub_key* is a string that names the subkey to delete. If ``None``,
184+
deletes all subkeys and values of the specified key.
185+
186+
This function deletes a key and all its descendants. If *sub_key* is
187+
``None``, all subkeys and values of the specified key are deleted.
188+
189+
If the function succeeds, the entire key tree is removed.
190+
If the function fails, an :exc:`OSError` exception is raised.
191+
192+
.. audit-event:: winreg.DeleteTree key,sub_key winreg.DeleteTree
193+
194+
.. versionadded:: next
195+
196+
176197
.. function:: DeleteValue(key, value)
177198

178199
Removes a named value from a registry key.

0 commit comments

Comments
 (0)