Skip to content

Commit

Permalink
Merge pull request #897 from asottile/slight-improvement
Browse files Browse the repository at this point in the history
slight improvement to except fix
  • Loading branch information
asottile committed Sep 23, 2023
2 parents 34de3a0 + 72acd1c commit 0d46cba
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions pyupgrade/_plugins/exceptions.py
Expand Up @@ -52,9 +52,7 @@ def _fix_except(
start = find_op(tokens, except_index, '(')
func_args, end = parse_call_args(tokens, start)

# save the exceptions and remove the block
arg_strs = [arg_str(tokens, *arg) for arg in func_args]
del tokens[start:end]

# rewrite the block without dupes
args = []
Expand All @@ -74,8 +72,7 @@ def _fix_except(
else:
joined = unique_args[0]

new = Token('CODE', joined)
tokens.insert(start, new)
tokens[start:end] = [Token('CODE', joined)]


def _get_rewrite(
Expand Down

0 comments on commit 0d46cba

Please sign in to comment.