Missing import warnings when importing fully-qualified modules
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Pyflakes |
Confirmed
|
Low
|
Unassigned |
Bug Description
Importing modules using fully-qualified paths appears to confuse pyflakes. Example #1:
'''
$ cat pyflakes-
import somepackage.mod1
import somepackage.mod2
def do_something():
somepackage
$ pyflakes pyflakes-
'''
Expected output: an "unused import" warning about somepackage.mod2.
Actual output: no errors or warnings.
Example #2:
'''
$ cat pyflakes-
import somepackage.mod2
def do_something():
somepackage
$ pyflakes pyflakes-
'''
Expected output: a "missing import" error about somepackage.mod1 *and* an "unused import" warning about somepackage.mod2.
Actual output: no errors or warnings.
Indeed, this is an issue. Fixing it will require some substantial rework of Pyflakes' data model, because currently it doesn't know anything about attributes.