Skip to content

Commit b1b2f36

Browse files
dirk-thomasjayvdb
authored andcommitted
add test for false warning about unused exception when using locals()
1 parent 15a35c1 commit b1b2f36

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

Diff for: pyflakes/test/test_other.py

+9
Original file line numberDiff line numberDiff line change
@@ -1660,6 +1660,15 @@ def foo():
16601660
except (tokenize.TokenError, IndentationError): pass
16611661
''')
16621662

1663+
def test_exceptUnusedAsLocals(self):
1664+
"""
1665+
Don't issue false warning when an exception is used by locals().
1666+
"""
1667+
self.flakes('''
1668+
try: raise ValueError()
1669+
except ValueError as e: locals()
1670+
''')
1671+
16631672
def test_augmentedAssignmentImportedFunctionCall(self):
16641673
"""
16651674
Consider a function that is called on the right part of an

0 commit comments

Comments
 (0)