Backport of contextlib.chdir stdlib class added in Python3.11.
Project Links
Meta
Author: Álvaro Mondéjar Rubio
Requires Python: >=3.6,<4.0
Classifiers
License
- Other/Proprietary License
Programming Language
- Python :: 3
- Python :: 3.6
- Python :: 3.7
- Python :: 3.8
- Python :: 3.9
- Python :: 3.10
contextlib-chdir
Backport of contextlib.chdir stdlib class added in Python3.11.
Install
pip install contextlib-chdir
Usage
import os
import tempfile
from contextlib_chdir import chdir as chdir_ctx
with chdir_ctx(tempfile.gettempdir()):
print(os.getcwd()) # /tmp
Note
You'll probably want to migrate to contextlib2 when
this change is included.
Wheel compatibility matrix
Files in release
No dependencies