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

multi-line exception with duplicate BaseException and comments gives invalid code #932

Closed
jakkdl opened this issue Feb 13, 2024 · 0 comments · Fixed by #933
Closed

multi-line exception with duplicate BaseException and comments gives invalid code #932

jakkdl opened this issue Feb 13, 2024 · 0 comments · Fixed by #933

Comments

@jakkdl
Copy link

jakkdl commented Feb 13, 2024

before

try:
    ...
except (
    BaseException,
    BaseException # b
):
    ...

after

try:
    ...
except (BaseException, BaseException # b):
    ...

info

I expect you never intend to output invalid code, and similar errors could probably pop up in normal usage. I don't have much of an opinion on whether pyupgrade does nothing, or actually manages to remove the BaseException and move the comment somewhere else.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant