diff --git a/.idea/vcs.xml b/.idea/vcs.xml new file mode 100644 index 0000000..94a25f7 --- /dev/null +++ b/.idea/vcs.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/fissix/fixes/fix_except.py b/fissix/fixes/fix_except.py index 3f710c6..c1af9df 100644 --- a/fissix/fixes/fix_except.py +++ b/fissix/fixes/fix_except.py @@ -56,8 +56,9 @@ def transform(self, node, results): for except_clause, e_suite in find_excepts(try_cleanup): if len(except_clause.children) == 4: (E, comma, N) = except_clause.children[1:4] - comma.replace(Name("as", prefix=" ")) - changed = True + if ',' in comma.value: + comma.replace(Name("as", prefix=" ")) + changed = True if N.type != token.NAME: # Generate a new N for the except clause diff --git a/fissix/tests/data/fixers/fixer_except.py b/fissix/tests/data/fixers/fixer_except.py new file mode 100644 index 0000000..e69de29