Skip to content

Commit 8e2f493

Browse files
dirk-thomasjayvdb
authored andcommitted
add test for false warning about unused exception when using locals()
1 parent 4b2d720 commit 8e2f493

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

pyflakes/test/test_other.py

+9
Original file line numberDiff line numberDiff line change
@@ -1650,6 +1650,15 @@ def foo():
16501650
except (tokenize.TokenError, IndentationError): pass
16511651
''')
16521652

1653+
def test_exceptUnusedAsLocals(self):
1654+
"""
1655+
Don't issue false warning when an exception is used by locals().
1656+
"""
1657+
self.flakes('''
1658+
try: raise ValueError()
1659+
except ValueError as e: locals()
1660+
''')
1661+
16531662
def test_augmentedAssignmentImportedFunctionCall(self):
16541663
"""
16551664
Consider a function that is called on the right part of an

0 commit comments

Comments
 (0)