Detect misuse of except
Bug #848455 reported by
Tristan Seligmann
This bug affects 3 people
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Pyflakes |
New
|
Wishlist
|
Unassigned | ||
pyflakes (Debian) |
Confirmed
|
Unknown
|
Bug Description
It would be nice if pyflakes could detect mistakes like this:
try:
oldtime = os.path.
except OSError, IOError:
oldtime = 0
In the general case, it's obviously difficult to tell whether this is an error or not; but I suspect that handling the exception variable name as a binding would give you a "redefinition of Foo" warning in most of the cases where a mistake has been made.
Changed in pyflakes: | |
importance: | Undecided → Wishlist |
Changed in pyflakes (Debian): | |
status: | Unknown → New |
Changed in pyflakes (Debian): | |
status: | New → Confirmed |
Changed in pyflakes: | |
status: | Fix Released → New |
To post a comment you must log in.
Sounds reasonable. At least it would be interesting to run such a check against existing codebases to see what comes up. :)