Skip to content

regression in 2.0.0: add test for false warning about unused exception when using locals() #333

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions pyflakes/test/test_other.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down