Warn about string exceptions
Bug #848470 reported by
Tristan Seligmann
This bug affects 2 people
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Pyflakes |
New
|
Wishlist
|
Unassigned | ||
pyflakes (Debian) |
Confirmed
|
Unknown
|
Bug Description
These can take several forms:
raise "shouldn't happen"
raise 'Cannot determine type of callable: '+repr(
raise "Can't read input parameters file : %s" % options.input_file
Some of these will be harder to detect than others.
Changed in pyflakes: | |
importance: | Undecided → Wishlist |
Changed in pyflakes (Debian): | |
status: | Unknown → New |
Changed in pyflakes (Debian): | |
status: | New → Confirmed |
To post a comment you must log in.
Pyflakes still supports python 2.5, where string exceptions are still allowed. Pyflakes has no way to know what the target python version is, so must take the conservative approach and assume the code might be targeted at python 2.5 and string exceptions are valid.
For code targeted at later versions, I suggest catching these errors in unit tests.