-
Notifications
You must be signed in to change notification settings - Fork 3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Prefer stdlib contextlib over contextlib2 when available #9384
Conversation
Is |
When I run |
Thanks for the review! The latest revision removes contextlib2 entirely and adds the suggested compat shim. This is used in testing only, so it is placed in the |
Not as far as I can see. Is that behaviour still happening for you (I'd be surprised, since CI seems to be happy; and we're running it on CI)? |
Okay, it looks like my |
Ah, interesting! I'll investigate this sometime next year -- would you be able to file an issue over in pradyunsg/vendoring for this? |
This will need to be rebased to master to fix the test suite for setuptools 52.0. |
Rebase needed! |
Hello! I am an automated bot and I have noticed that this pull request is not currently able to be merged. If you are able to either merge the |
rebased |
Removes the vendored contextlib2. ExitStack and suppress are available from stdlib contextlib on all supported Python versions. The nullcontext context manager which isn't available in Python 3.6, but the function is simple to implement. Once Python 3.6 support is dropped, so too can the compat shim.
ExitStack and suppress are available from stdlib contextlib on all
supported Python versions.
contextlib2 remains for the nullcontext context manager, which isn't
available in Python 3.6.