]> git.ipfire.org Git - thirdparty/Python/cpython.git/commit
bpo-25625: add contextlib.chdir (GH-28271)
authorFilipe Laíns <lains@riseup.net>
Tue, 19 Oct 2021 22:19:27 +0000 (23:19 +0100)
committerGitHub <noreply@github.com>
Tue, 19 Oct 2021 22:19:27 +0000 (00:19 +0200)
commit3592980f9122ab0d9ed93711347742d110b749c2
treee1e3a4894a60187a5152c2a8c3ae648987f5f75b
parentad6d162e518963711d24c80f1b7d6079bd437584
bpo-25625: add contextlib.chdir (GH-28271)

Added non parallel-safe :func:`~contextlib.chdir` context manager to change
the current working directory and then restore it on exit. Simple wrapper
around :func:`~os.chdir`.

Signed-off-by: Filipe Laíns <lains@riseup.net>
Co-authored-by: Łukasz Langa <lukasz@langa.pl>
Doc/library/contextlib.rst
Lib/contextlib.py
Lib/test/test_contextlib.py
Misc/NEWS.d/next/Library/2021-09-10-12-53-28.bpo-25625.SzcBCw.rst [new file with mode: 0644]