-
-
Notifications
You must be signed in to change notification settings - Fork 7.9k
Cleanups. #11566
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
Cleanups. #11566
Conversation
@@ -1417,19 +1417,15 @@ def tk_window_focus(): | |||
|
|||
|
|||
def _init_tests(): | |||
try: | |||
# CPython's faulthandler since v3.6 handles exceptions on Windows |
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'm not fully grokking this, but I thought we were supporting 3.5 for the next release...
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.
faulthandler exists since 3.3: https://docs.python.org/3.3/library/faulthandler.html
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.
Yes, but why does the comment make reference to "since v3.6"?
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 exists on all version (so we don't need the import check), but still need the version check to know if we want to use it on windows or not.
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.
Pending CI.
- faulthandler is present in all versions of Python we support; no need for `try... except ImportError` anymore. - LooseVersions can directly be compared to strings (it casts the other argument to a LooseVersion). - Move the gi+cairocffi incompatibility check (duplicated between backend_gtk3agg and backend_gtk3cairo) to the common _gtk3_compat. - Replace HAS_CAIRO_CFFI with checking `cairo.__name__`, which is consistent with e.g. the check on `gi.__name__`. - Inline the (single-used, internal) pilread (I think the new version is also more readable as we don't need to handle None as special value). - Replace HAS_NATGRID by pytest.importorskip.
for
try... except ImportError
anymore.argument to a LooseVersion).
backend_gtk3agg and backend_gtk3cairo) to the common _gtk3_compat.
cairo.__name__
, which isconsistent with e.g. the check on
gi.__name__
.also more readable as we don't need to handle None as special value).
PR Summary
PR Checklist