bpo-43202: More codeop._maybe_compile clean-ups #24512
Merged
+7
−7
Conversation
Add comment, end others with period, remove unused variables, initialize others only when needed, and add explicit return.
I believe that the ending try-finally construct is only needed if the 2nd or 3rd compile after a SyntaxError could raise a non-SyntaxError exception. I strongly suspect that this never happens and maybe never could. If so, the err1,2 traceback cleanup could be done before before 'raise err1'. But not being 100% sure, I omitted this change. I intend to address the possible non-SyntaxError compile failures on another issue and PR. |
else: | ||
return None |
Comment on lines
+103
to
+104
terryjreedy
Feb 13, 2021
Author
Member
Thanks for reviewing. This choice is a matter of personal preference. I thought of leaving out 'else', but prefer it here.
Looks good, I made a suggestion |
b676f5f
into
python:master
10 checks passed
10 checks passed
bedevere/news
"skip news" label found
Nonchasd
added a commit
to Nonchasd/cpython
that referenced
this pull request
Feb 13, 2021
…)" This reverts commit b676f5f.
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.
Add comment, end others with period, remove unused variables,
initialize others only when needed, and add explicit return.
https://bugs.python.org/issue43202