[Python-projects] pylint fails to diagnose missing import.

Carsten Koch CarstenKochElsdorf at web.de
Thu Nov 6 19:34:13 CET 2008


Hi,

with this

---------------------------------------------------
"""
   Test case for pylint bug.
"""
__revision__ = 0

import modules.utilities

print modules.rpc.rpc_call
print modules.rpc.murks
---------------------------------------------------

test case, pylint says:

cko/puwa> pylint -r n test.py
************* Module test
E:  9: Module 'modules.rpc' has no 'murks' member

while python says:


cko/puwa> python test.py
Traceback (most recent call last):
  File "test.py", line 8, in <module>
    print modules.rpc.rpc_call
AttributeError: 'module' object has no attribute 'rpc'

Please note that the test case imports the wrong
module (modules.utilities instead of modules.rpc).
pylint ignores that and correctly finds out that
modules.rpc does contain a rpc_call function and
no murks function.

I would have expected pylint to tell me that I
failed to import modules.rpc.

Can this be fixed?

It would be very helpful if pylint would find these errors.

Carsten.


More information about the Python-Projects mailing list