-
Notifications
You must be signed in to change notification settings - Fork 29.8k
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
tools: fix Python 3 deprecation warning in test.py #30208
Conversation
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.
Beautiful! Thanks much.
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 a lot!
nit: indentation should be two spaces
If you want GitHub to register your contribution, you need to add the email address used for the commit to your account (at https://github.com/settings/emails) |
fixed! |
PR-URL: #30208 Reviewed-By: Christian Clauss <[email protected]> Reviewed-By: Anna Henningsen <[email protected]> Reviewed-By: Michaël Zasso <[email protected]> Reviewed-By: David Carlier <[email protected]>
PR-URL: #30208 Reviewed-By: Christian Clauss <[email protected]> Reviewed-By: Anna Henningsen <[email protected]> Reviewed-By: Michaël Zasso <[email protected]> Reviewed-By: David Carlier <[email protected]>
PR-URL: #30208 Reviewed-By: Christian Clauss <[email protected]> Reviewed-By: Anna Henningsen <[email protected]> Reviewed-By: Michaël Zasso <[email protected]> Reviewed-By: David Carlier <[email protected]>
PR-URL: #30208 Reviewed-By: Christian Clauss <[email protected]> Reviewed-By: Anna Henningsen <[email protected]> Reviewed-By: Michaël Zasso <[email protected]> Reviewed-By: David Carlier <[email protected]>
PR-URL: #30208 Reviewed-By: Christian Clauss <[email protected]> Reviewed-By: Anna Henningsen <[email protected]> Reviewed-By: Michaël Zasso <[email protected]> Reviewed-By: David Carlier <[email protected]>
PR-URL: #30208 Reviewed-By: Christian Clauss <[email protected]> Reviewed-By: Anna Henningsen <[email protected]> Reviewed-By: Michaël Zasso <[email protected]> Reviewed-By: David Carlier <[email protected]>
Since Python 3.4, the
imp
module is deprecated, causing a deprecation warning when runningtools/test.py
.This fixes it by conditionally using
importlib
instead when runningtools/test.py
with Python 3.5+.Notes:
importlib.util.module_from_spec()
isn't available. Python 3 < 3.5 reached EOL so this should not be an issue.importlib.machinery.FileFinder
should match the the behaviour ofimp.find_module()
and find any Python-recognised module file (liketestcfg.py
).Checklist
make -j4 test
(UNIX), orvcbuild test
(Windows) passes