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

bpo-43202: More codeop._maybe_compile clean-ups #24512

Merged
merged 1 commit into from Feb 13, 2021

Conversation

@terryjreedy
Copy link
Member

@terryjreedy terryjreedy commented Feb 12, 2021

Add comment, end others with period, remove unused variables,
initialize others only when needed, and add explicit return.

https://bugs.python.org/issue43202

Add comment, end others with period, remove unused variables,
initialize others only when needed, and add explicit return.
@terryjreedy
Copy link
Member Author

@terryjreedy terryjreedy commented Feb 12, 2021

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

This comment has been minimized.

@pablogsal

pablogsal Feb 12, 2021
Member

Suggested change
else:
return None
return None

This comment has been minimized.

@terryjreedy

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.

Copy link
Member

@pablogsal pablogsal left a comment

Looks good, I made a suggestion

@terryjreedy terryjreedy merged commit b676f5f into python:master Feb 13, 2021
10 checks passed
10 checks passed
Check for source changes
Details
Check if generated files are up to date
Details
Windows (x86)
Details
Windows (x64)
Details
macOS
Details
Ubuntu
Details
Azure Pipelines PR #20210212.4 succeeded
Details
Travis CI - Pull Request Build Passed
Details
bedevere/issue-number Issue number 43202 found
Details
bedevere/news "skip news" label found
@terryjreedy terryjreedy deleted the terryjreedy:maycom2 branch Feb 13, 2021
Nonchasd added a commit to Nonchasd/cpython that referenced this pull request Feb 13, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

4 participants