Learn how easy it is to sync an existing GitHub or Google Code repo to a SourceForge project! See Demo

Close

#1011 Wrong "Undefined variable from import"

closed-works-for-me
nobody
None
5
2009-11-21
2009-11-15
cato
No

PyDev shows the error "Undefined variable from import: TCPServer" when the referenced variable was defined in __all__ in the imported package.

An example is TCPServer from twisted.application.internet. More here:
> http://twistedmatrix.com/documents/8.2.0/api/twisted.application.internet.html
source here:
> http://twistedmatrix.com/trac/browser/tags/releases/twisted-8.2.0/twisted/application/internet.py#L267

Ubuntu 9.10 karmic, Eclipse 3.5.1, PyDev 1.5.0.1251989166

Discussion

  • Fabio Zadrozny
    Fabio Zadrozny
    2009-11-21

    I haven actually tried it, but it seems that that module has a lot of runtime information which the static analyzer cannot get... you can try to fix that by adding "twisted.application.internet" to the forced builtins. See: http://pydev.org/manual_101_interpreter.html

     
  • Fabio Zadrozny
    Fabio Zadrozny
    2009-11-21

    • status: open --> closed-works-for-me