contextlib-chdir 1.0.2


pip install contextlib-chdir

  Latest version

Released: Jun 08, 2022

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

Platform Python 3
any

Files in release

No dependencies