-
-
Notifications
You must be signed in to change notification settings - Fork 7.9k
Fix a number of Deprecated/Invalid escape sequences #7925
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -14,6 +14,28 @@ | |
|
||
|
||
if __name__ == '__main__': | ||
|
||
try: | ||
import setuptools | ||
except ImportError: | ||
pass | ||
|
||
# The warnings need to be before any of matplotlib imports, but after | ||
# setuptools (if present) which has syntax error with the warnings enabled. | ||
# Filtering by module does not work as this will be raised by Python itself. | ||
# so `module=matplotlib.*` is out of questions. | ||
|
||
import warnings | ||
|
||
# Python 3.6 deprecate invalid character-pairs \A, \* ... in non raw-strings | ||
# and other things. Let's not re-introduce them | ||
warnings.filterwarnings('error', '.*invalid escape sequence.*', | ||
category=DeprecationWarning) | ||
warnings.filterwarnings( | ||
'default', | ||
'.*inspect.getargspec\(\) is deprecated.*', | ||
category=DeprecationWarning) | ||
|
||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This only gets executed when running tests.py, and I think most tests have been migrated to pytest now. Is there a way to make pytest execute these filterwarnings calls? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yes. It's supposed to get folded into Pytest itself at some point. |
||
from matplotlib import test | ||
|
||
parser = argparse.ArgumentParser(add_help=False) | ||
|
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.
It appears that this line is under 79 characters and this file now passes PEP8, so it needs to be removed from
lib/matplotlib/tests/test_coding_standards.py
because the build is failing.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.
Also, since you're going to have to push an update, I cancelled the OSX build which has been waiting for a while because we've got a long backlog.