make lint should recognize (and not warn about) try...except imports of modules
Bug #245514 reported by
Eleanor Berger
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Launchpad itself |
Fix Released
|
High
|
Curtis Hovey |
Bug Description
Occasionally we want to import a module, but only if the import of another module fails, using the same name. For example, this is a popular idiom when importing a module which has a native code version which is only available on some tergets:
try:
from themodule import TheClass
except:
from cThemodule import cTheClass as TheClass
Currently, PyFlakes warns about such cases, but it should be possible to recognize that this is valid, and not warn.
We could either try to fix PyFlakes, or figure out in what cases it's safe to ignore the warning.
Changed in launchpad: | |
importance: | Undecided → Medium |
status: | New → Confirmed |
visibility: | private → public |
Changed in launchpad-foundations: | |
assignee: | nobody → Curtis Hovey (sinzui) |
milestone: | none → 10.08 |
status: | Triaged → In Progress |
importance: | Medium → High |
Changed in launchpad-foundations: | |
status: | In Progress → Fix Released |
tags: | added: qa-ok |
To post a comment you must log in.
Is this a problem in our use of lint, or a limitations of lint itself?