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

Fix PR #40 (except fixer: don't do anything if the "as" is already there) by checking against value of node #42

Closed
dgrant opened this issue Jun 8, 2021 · 1 comment · Fixed by #43

Comments

@dgrant
Copy link
Contributor

dgrant commented Jun 8, 2021

Description

My fix PR #40 didn't actually do anything. I must have dropped the .value during some refactoring.

Luckily this doesn't cause any regression.

@chriselion
Copy link
Contributor

Just for posterity, here's an example case:
test.py: python

try:
    pass
except Exception as e:
    pass

Using fissix==21.6.6 and modernize==0.8.0

modernize --write --enforce --nobackups --fix=except test2.py; echo $?

produces

 Loading the following fixers:
    fissix.fixes.fix_except  (except)
 Applying the following explicit transformations:
    fissix.fixes.fix_except  (except)

RefactoringTool: No changes to test2.py
RefactoringTool: Files that need to be modified:
RefactoringTool: test2.py
2

I would expect the output to be something like

...
RefactoringTool: No changes to test2.py
0

amyreese added a commit that referenced this issue Nov 13, 2021
except fixer: Make sure to actually check against the value of a node Fixes #42
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.

2 participants