Incorrect 'undefined name' in presence of conditional del statement

Bug #1212912 reported by Steve Leonard
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Pyflakes
New
Wishlist
Unassigned

Bug Description

Reproducible with this code:
# example.py
x = 7
if False:
    del x
else:
    print x

$>pyflakes example.py
example.py:5: undefined name 'x'
# This corresponds to the line 'print x'

$>pyflakes --version
0.7.3

Revision history for this message
Florent (florent.x) wrote :

Thank you for the report.
This case is not easy to support with Pyflakes.

The workaround is to refactor the source code which gives a false positive.

Changed in pyflakes:
importance: Undecided → Wishlist
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.