diff --git a/pyflakes/test/test_other.py b/pyflakes/test/test_other.py index 364b3750..abf08f9b 100644 --- a/pyflakes/test/test_other.py +++ b/pyflakes/test/test_other.py @@ -1650,6 +1650,15 @@ def foo(): except (tokenize.TokenError, IndentationError): pass ''') + def test_exceptUnusedAsLocals(self): + """ + Don't issue false warning when an exception is used by locals(). + """ + self.flakes(''' + try: raise ValueError() + except ValueError as e: locals() + ''') + def test_augmentedAssignmentImportedFunctionCall(self): """ Consider a function that is called on the right part of an