We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 19b1966 commit 72acd1cCopy full SHA for 72acd1c
pyupgrade/_plugins/exceptions.py
@@ -52,9 +52,7 @@ def _fix_except(
52
start = find_op(tokens, except_index, '(')
53
func_args, end = parse_call_args(tokens, start)
54
55
- # save the exceptions and remove the block
56
arg_strs = [arg_str(tokens, *arg) for arg in func_args]
57
- del tokens[start:end]
58
59
# rewrite the block without dupes
60
args = []
@@ -74,8 +72,7 @@ def _fix_except(
74
72
else:
75
73
joined = unique_args[0]
76
77
- new = Token('CODE', joined)
78
- tokens.insert(start, new)
+ tokens[start:end] = [Token('CODE', joined)]
79
80
81
def _get_rewrite(
0 commit comments