FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

tools: fix Python 3 deprecation warning in test.py by Hellzed · Pull Request #30208 · nodejs/node · GitHub

/ node Public

tools: fix Python 3 deprecation warning in test.py - #30208

Closed
Hellzed wants to merge 2 commits into
nodejs:masterfrom
Hellzed:fix-test-imp-deprecation-warning
Closed

tools: fix Python 3 deprecation warning in test.py#30208
Hellzed wants to merge 2 commits into
nodejs:masterfrom
Hellzed:fix-test-imp-deprecation-warning

Conversation

Hellzed commented Nov 1, 2019

Copy link
Copy Markdown
Contributor

Since Python 3.4, the imp module is deprecated, causing a deprecation warning when running tools/test.py.

This fixes it by conditionally using importlib instead when running tools/test.py with Python 3.5+.

Notes:

  • Python 3 < 3.5 is not supported, since importlib.util.module_from_spec() isn't available. Python 3 < 3.5 reached EOL so this should not be an issue.
  • the use of a importlib.machinery.FileFinder should match the the behaviour of imp.find_module() and find any Python-recognised module file (like testcfg.py).
Checklist
  • make -j4 test (UNIX), or vcbuild test (Windows) passes
  • commit message follows commit guidelines

nodejs-github-bot added test Issues and PRs related to the tests. tools Issues and PRs related to the tools directory. labels Nov 1, 2019

cclauss left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

Beautiful! Thanks much.

targos left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

Thanks a lot!

nit: indentation should be two spaces

targos commented Nov 1, 2019

Copy link
Copy Markdown
Member

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)

cclauss added the python PRs and issues that require attention from people who are familiar with Python. label Nov 1, 2019

Hellzed commented Nov 1, 2019
edited
Loading

Copy link
Copy Markdown
Contributor Author

nit: indentation should be two spaces

fixed!

Copy link
Copy Markdown
Collaborator

cclauss pushed a commit that referenced this pull request Nov 3, 2019
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>

cclauss commented Nov 3, 2019

Copy link
Copy Markdown
Contributor

Thanks @Hellzed for a great first contribution.

Landed in bdee976

cclauss closed this Nov 3, 2019
targos pushed a commit that referenced this pull request Nov 5, 2019
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>
targos mentioned this pull request Nov 5, 2019
targos pushed a commit that referenced this pull request Nov 8, 2019
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>
targos pushed a commit that referenced this pull request Nov 10, 2019
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>
targos pushed a commit that referenced this pull request Nov 10, 2019
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>
targos pushed a commit that referenced this pull request Nov 11, 2019
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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

python PRs and issues that require attention from people who are familiar with Python. test Issues and PRs related to the tests. tools Issues and PRs related to the tools directory.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants


Back | FazBrowse Home | New Git URL