diff options
author | Georg Brandl <georg@python.org> | 2008-01-08 16:18:26 (GMT) |
---|---|---|
committer | Georg Brandl <georg@python.org> | 2008-01-08 16:18:26 (GMT) |
commit | 502d6312db1bb691a6fb479f3df1a445d5b0684d (patch) | |
tree | db59f5ede9fad9ce6ac70cf3a25301fd2ad2fa11 | |
parent | b39a756afd08a2261dffe2b649f3a3550fb6294f (diff) | |
download | cpython-502d6312db1bb691a6fb479f3df1a445d5b0684d.zip cpython-502d6312db1bb691a6fb479f3df1a445d5b0684d.tar.gz cpython-502d6312db1bb691a6fb479f3df1a445d5b0684d.tar.bz2 |
Fix markup errors from r59857 and clarify key.__enter__/__exit__ docs
-rw-r--r-- | Doc/library/_winreg.rst | 27 |
1 files changed, 16 insertions, 11 deletions
diff --git a/Doc/library/_winreg.rst b/Doc/library/_winreg.rst index 2544b5a..6aed8cb 100644 --- a/Doc/library/_winreg.rst +++ b/Doc/library/_winreg.rst @@ -136,11 +136,11 @@ This module offers the following functions: .. function:: ExpandEnvironmentStrings(unicode) Expands environment strings %NAME% in unicode string like const:`REG_EXPAND_SZ`:: - - >>> ExpandEnvironmentStrings(u"%windir%") - u"C:\\Windows" - - .. versionadded: 2.6 + + >>> ExpandEnvironmentStrings(u"%windir%") + u"C:\\Windows" + + .. versionadded:: 2.6 .. function:: FlushKey(key) @@ -429,10 +429,15 @@ handle, and also disconnect the Windows handle from the handle object. underlying Win32 handle to exist beyond the lifetime of the handle object. .. method:: PyHKEY.__enter__() -.. method:: PyHKEY.__exit__(*exc_info) - - The HKEY object implements __enter__ and __exit__ and thus supports the - context protocol for the with statement. - - .. versionadded: 2.6 + PyHKEY.__exit__(\*exc_info) + + The HKEY object implements :meth:`__enter__` and :meth:`__exit__` and thus + supports the context protocol for the :keyword:`with` statement:: + + with OpenKey(HKEY_LOCAL_MACHINE, "foo") as key: + # ... work with key ... + + will automatically close *key* when control leaves the :keyword:`with` block. + + .. versionadded:: 2.6 |