-
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: revise install.py for minor improvements #36626
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.
Not blocking, but could those changes be enforced by our Python linter?
tools/install.py
Outdated
@@ -19,7 +19,8 @@ def abspath(*args): | |||
return os.path.abspath(path) | |||
|
|||
def load_config(): | |||
s = open('config.gypi').read() | |||
with open('config.gypi') as f: | |||
s = f.read() |
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.
s = f.read() | |
return ast.literal_eval(f.read()) |
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.
Added in a fixup commit. Thanks for the review!
* Use an with block for reading the config file. Refs: https://docs.python.org/3/tutorial/inputoutput.html#reading-and-writing-files * Use explicit blank return to make it clear that the return value is not actually used and that it is being used for flow control only.. PR-URL: nodejs#36626 Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com> Reviewed-By: Christian Clauss <cclauss@me.com>
46ee377
to
245159f
Compare
Landed in 245159f |
* Use an with block for reading the config file. Refs: https://docs.python.org/3/tutorial/inputoutput.html#reading-and-writing-files * Use explicit blank return to make it clear that the return value is not actually used and that it is being used for flow control only.. PR-URL: #36626 Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com> Reviewed-By: Christian Clauss <cclauss@me.com>
* Use an with block for reading the config file. Refs: https://docs.python.org/3/tutorial/inputoutput.html#reading-and-writing-files * Use explicit blank return to make it clear that the return value is not actually used and that it is being used for flow control only.. PR-URL: #36626 Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com> Reviewed-By: Christian Clauss <cclauss@me.com>
Use an with block for reading the config file.
Refs: https://docs.python.org/3/tutorial/inputoutput.html#reading-and-writing-files
Use explicit blank return to make it clear that the return value is
not actually used and that it is being used for flow control only..
Checklist
make -j4 test
(UNIX), orvcbuild test
(Windows) passes