-
-
Notifications
You must be signed in to change notification settings - Fork 33.8k
tools: fix Python 3 deprecation warning in test.py #30208
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
Conversation
cclauss
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.
Beautiful! Thanks much.
targos
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.
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
impmodule is deprecated, causing a deprecation warning when runningtools/test.py.This fixes it by conditionally using
importlibinstead when runningtools/test.pywith 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.FileFindershould 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