We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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_except returns FP even when the code contains try..except according to Python 3 specification
After looking into the issue, i think the problem is with the transform function in fix_except, where it only looks for the length of the except clause. https://github.com/jreese/fissix/blob/main/fissix/fixes/fix_except.py
if len(except_clause.children) == 4: (E, comma, N) = except_clause.children[1:4] comma.replace(Name("as", prefix=" ")) changed = True
A fix for this can be checking if there is a command being used.
Reproduction code:
Taken from https://docs.python.org/3/tutorial/errors.html
def test(): try: raise NameError('HiThere') except Exception as e: print('An exception flew by!')
The text was updated successfully, but these errors were encountered:
Successfully merging a pull request may close this issue.
Description
fix_except returns FP even when the code contains try..except according to Python 3 specification
Details
After looking into the issue, i think the problem is with the transform function in fix_except, where it only looks for the length of the except clause.
https://github.com/jreese/fissix/blob/main/fissix/fixes/fix_except.py
A fix for this can be checking if there is a command being used.
Reproduction code:
Taken from https://docs.python.org/3/tutorial/errors.html
The text was updated successfully, but these errors were encountered: