]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
Docs: Link to the `contextlib.chdir` context manager in the `os.chdir` docs (#153152)
authorCody Maloney <cmaloney@users.noreply.github.com>
Mon, 6 Jul 2026 15:40:45 +0000 (08:40 -0700)
committerGitHub <noreply@github.com>
Mon, 6 Jul 2026 15:40:45 +0000 (15:40 +0000)
Co-authored-by: Stan Ulbrych <stan@python.org>
Doc/library/os.rst

index 7b043f257ca0b57a9f8728778e1c7bcffb234a2e..6331ba4a034c5c6d9149da56ad03a0c4fbe32c54 100644 (file)
@@ -2180,6 +2180,11 @@ features:
 
    .. audit-event:: os.chdir path os.chdir
 
+   .. seealso::
+
+      The :func:`contextlib.chdir` context manager, which changes the current
+      working directory on entering and restores the previous one on exit.
+
    .. versionchanged:: 3.3
       Added support for specifying *path* as a file descriptor
       on some platforms.