Refactor PyImport_ImportModuleLevelObject().#4680
Merged
nascheme merged 2 commits intopython:masterfrom Dec 3, 2017
Merged
Conversation
Add import_find_and_load() helper function. The addition of the importtime option has made PyImport_ImportModuleLevelObject() large and so using a helper seems worthwhile. It also makes it clearer that abs_name is the only argument needed by _find_and_load().
3e15686 to
864202a
Compare
methane
reviewed
Dec 2, 2017
| mod = import_find_and_load(abs_name); | ||
| if (mod == NULL) | ||
| goto error; | ||
| } |
Member
There was a problem hiding this comment.
Don't remove braces when existing code use braces.
https://www.python.org/dev/peps/pep-0007/
Code structure: one space between keywords like if, for and the following left paren; no spaces inside the paren; braces are required everywhere, even where C permits them to be omitted, but do not add them to code you are not otherwise modifying. All new C code requires braces.
0dminnimda
reviewed
Jan 30, 2022
| mod != NULL); | ||
|
|
||
| if (import_time) { | ||
| _PyTime_t cum = _PyTime_GetPerfCounter() - t1; |
There was a problem hiding this comment.
I see .. a cultured individual .. good job 🔥
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
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Add import_find_and_load() helper function. The addition of
the importtime option has made PyImport_ImportModuleLevelObject() large
and so using a helper seems worthwhile. It also makes it clearer that
abs_name is the only argument needed by _find_and_load().