-
Notifications
You must be signed in to change notification settings - Fork 30.1k
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 <cclauss@me.com> Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Michaël Zasso <targos@protonmail.com> Reviewed-By: David Carlier <devnexen@gmail.com>
PR-URL: #30208 Reviewed-By: Christian Clauss <cclauss@me.com> Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Michaël Zasso <targos@protonmail.com> Reviewed-By: David Carlier <devnexen@gmail.com>
PR-URL: #30208 Reviewed-By: Christian Clauss <cclauss@me.com> Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Michaël Zasso <targos@protonmail.com> Reviewed-By: David Carlier <devnexen@gmail.com>
PR-URL: #30208 Reviewed-By: Christian Clauss <cclauss@me.com> Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Michaël Zasso <targos@protonmail.com> Reviewed-By: David Carlier <devnexen@gmail.com>
PR-URL: #30208 Reviewed-By: Christian Clauss <cclauss@me.com> Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Michaël Zasso <targos@protonmail.com> Reviewed-By: David Carlier <devnexen@gmail.com>
PR-URL: #30208 Reviewed-By: Christian Clauss <cclauss@me.com> Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Michaël Zasso <targos@protonmail.com> Reviewed-By: David Carlier <devnexen@gmail.com>
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