Merge lp:~dobey/divmod.org/pyflakes-less-redef into lp:divmod.org
Proposed by
dobey
Status: | Rejected |
---|---|
Rejected by: | Jean-Paul Calderone |
Proposed branch: | lp:~dobey/divmod.org/pyflakes-less-redef |
Merge into: | lp:divmod.org |
Diff against target: |
83 lines (+36/-2) 2 files modified
Pyflakes/pyflakes/checker.py (+22/-2) Pyflakes/pyflakes/test/test_imports.py (+14/-0) |
To merge this branch: | bzr merge lp:~dobey/divmod.org/pyflakes-less-redef |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Florent (community) | Disapprove | ||
Jean-Paul Calderone | Needs Fixing | ||
Review via email: mp+130183@code.launchpad.net |
Commit message
Add an ExceptHandler for dealing with ImportError cases of RedefinedWhileU
To post a comment you must log in.
Hiya. This is an error that a lot of people come across. It's been reported at least three times, even. :) It's somewhat tricky to resolve, though. For example, the change proposed here makes pyflakes stop reporting the error in this code:
try:
pass
except ImportError:
import foo
import bar as foo
print foo
Some amount of care is needed in implementing this to ensure that at least existing functionality is preserved. Beyond that, it's probably also necessary to handle quite a variety of variations on this error. The later can be addressed incrementally, at least, but it's really necessary to keep the former in mind at every stage.