Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork8.1k
Use general OSError and more Python3 defaults from pyupgrade#19241
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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
Uh oh!
There was an error while loading.Please reload this page.
Conversation
timhoffm left a comment• edited
Loading Uh oh!
There was an error while loading.Please reload this page.
edited
Uh oh!
There was an error while loading.Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
Thanks for the PR, and welcome to Matplotlib!
Generally 👍 apart from the changes toversioneer.py.
versioneer.py Outdated
| """ | ||
| from __future__importprint_function |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
Please don't change anything inversioneer.py. It's a vendored file from (https://github.com/python-versioneer/python-versioneer) with slight modifications. Additional local changes make it harder to pull in changes from the upstream version.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
Thank you@timhoffm . I have removedversioneer.py from my PR entirely.
According to PEP 3151, OSError can be used for all system-related exceptions and thus replace IOError, EnvironmentError, socket.error, etc.
QuLogic left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
All theraise OSError(' for missing files should probably beFileNotFoundError instead.
| elseNone)) | ||
| break | ||
| exceptEnvironmentError: | ||
| exceptOSError: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
I would not bother changing this file either as it will be deleted by#18971 .
Uh oh!
There was an error while loading.Please reload this page.
PR Summary
Running
pyupgrade --py3-plusand ignoring all string updates (percent/format/f) to use defaults introduced in Python3.PR Checklist
pytestpasses).flake8on changed files to check).flake8-docstringsand runflake8 --docstring-convention=all).doc/users/next_whats_new/(follow instructions in README.rst there).doc/api/next_api_changes/(follow instructions in README.rst there).