Skip to content

Commit

Permalink
Add regression tests for issue pylint-dev#626
Browse files Browse the repository at this point in the history
  • Loading branch information
Pierre-Sassoulas committed Jul 30, 2021
1 parent 0380242 commit fed21f8
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion tests/functional/u/unused/unused_variable.py
Expand Up @@ -155,5 +155,14 @@ def func4():
try:
1 / 0
except ZeroDivisionError as error:
# TODO fix bug for not identifying unused variables in nested exceptions see issue #4391
# TODO fix bug for not identifying unused variables in nested exceptions see issue #4391
print("error")


def main():
# https://github.com/PyCQA/pylint/issues/626
try:
raise ValueError
except ValueError as e: # [unused-variable]
pass
print(e) # [undefined-variable]

0 comments on commit fed21f8

Please sign in to comment.