Skip to content
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: make test.py Queue part Python 3 compatible #25701

Closed
wants to merge 1 commit into from

Conversation

gengjiawen
Copy link
Member

@gengjiawen gengjiawen commented Jan 25, 2019

  • make -j4 test (UNIX), or vcbuild test (Windows) passes
  • commit message follows commit guidelines

cc @nodejs/python @cclauss

@nodejs-github-bot nodejs-github-bot added test Issues and PRs related to the tests. tools Issues and PRs related to the tools directory. labels Jan 25, 2019
@addaleax
Copy link
Member

@addaleax
Copy link
Member

This patch failed the python linter… /cc @nodejs/python

@cclauss
Copy link
Contributor

cclauss commented Jan 27, 2019

Just reverse the try except and change the exception to ImportError.

Copy link
Contributor

@thefourtheye thefourtheye left a comment

Choose a reason for hiding this comment

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

LGTM with @cclauss's suggested change.

@gengjiawen
Copy link
Member Author

gengjiawen commented Jan 28, 2019

I can change it. But the root cause is the lint bug.

@cclauss
Copy link
Contributor

cclauss commented Jan 28, 2019

The linter is not wrong ModuleNotFoundError does not exist in Python < 3.6 thus it is an undefined name. Please replace it with ImportError.

@gengjiawen
Copy link
Member Author

I see, thanks for the info.

tools/test.py Outdated
try:
from Queue import Queue, Empty # Python 2
except ModuleNotFoundError:
from queue import Queue, Empty # Python 3
Copy link
Contributor

Choose a reason for hiding this comment

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

try:
    from queue import Queue, Empty  # Python 3
except ImportError:
    from Queue import Queue, Empty  # Python 2

Copy link
Contributor

Choose a reason for hiding this comment

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

@gengjiawen
Copy link
Member Author

I will push again when I got home :)

Signed-off-by: gengjiawen <technicalcute@gmail.com>
@refack
Copy link
Contributor

refack commented Jan 28, 2019

@refack refack self-assigned this Jan 28, 2019
@addaleax
Copy link
Member

Landed in 08100bf

@addaleax addaleax closed this Jan 28, 2019
addaleax pushed a commit that referenced this pull request Jan 28, 2019
Signed-off-by: gengjiawen <technicalcute@gmail.com>

PR-URL: #25701
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Sakthipriyan Vairamani <thechargingvolcano@gmail.com>
Reviewed-By: Refael Ackermann <refack@gmail.com>
@refack refack removed their assignment Jan 28, 2019
@refack refack added the python PRs and issues that require attention from people who are familiar with Python. label Jan 28, 2019
addaleax pushed a commit that referenced this pull request Jan 28, 2019
Signed-off-by: gengjiawen <technicalcute@gmail.com>

PR-URL: #25701
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Sakthipriyan Vairamani <thechargingvolcano@gmail.com>
Reviewed-By: Refael Ackermann <refack@gmail.com>
@targos targos mentioned this pull request Jan 29, 2019
BethGriggs pushed a commit that referenced this pull request Apr 29, 2019
Signed-off-by: gengjiawen <technicalcute@gmail.com>

PR-URL: #25701
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Sakthipriyan Vairamani <thechargingvolcano@gmail.com>
Reviewed-By: Refael Ackermann <refack@gmail.com>
@BethGriggs BethGriggs mentioned this pull request May 1, 2019
BethGriggs pushed a commit that referenced this pull request May 10, 2019
Signed-off-by: gengjiawen <technicalcute@gmail.com>

PR-URL: #25701
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Sakthipriyan Vairamani <thechargingvolcano@gmail.com>
Reviewed-By: Refael Ackermann <refack@gmail.com>
MylesBorins pushed a commit that referenced this pull request May 16, 2019
Signed-off-by: gengjiawen <technicalcute@gmail.com>

PR-URL: #25701
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Sakthipriyan Vairamani <thechargingvolcano@gmail.com>
Reviewed-By: Refael Ackermann <refack@gmail.com>
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