#90 Import error

v3.0
closed-fixed
5
2006-08-21
2006-04-21
No

I get the following exception using epydoc3.0-alpha2.
The exception is thrown whether I'm using --parse-only
or not. The file on which it occurs is attached.

[ 21%] Adapters.ATSPI.PopupAdapter
(/usr/local/src/lsr/src/Adapters/ATSPI/PopupAdapter.pyc)
Traceback (most recent call last):
File "/usr/bin/epydoc", line 7, in ?
cli()
File
"/usr/lib/python2.4/site-packages/epydoc/cli.py", line
590, in cli
main(options, names)
File
"/usr/lib/python2.4/site-packages/epydoc/cli.py", line
429, in main
add_submodules=(options.action!='text'))
File
"/usr/lib/python2.4/site-packages/epydoc/docbuilder.py",
line 130, in build_doc_index
doc_pairs = _get_docs_from_items(items, introspect,
parse, add_submodules)
File
"/usr/lib/python2.4/site-packages/epydoc/docbuilder.py",
line 271, in _get_docs_from_items
doc_pairs += _get_docs_from_submodules(
File
"/usr/lib/python2.4/site-packages/epydoc/docbuilder.py",
line 454, in _get_docs_from_submodules
docs += _get_docs_from_submodules(
File
"/usr/lib/python2.4/site-packages/epydoc/docbuilder.py",
line 447, in _get_docs_from_submodules
d = _get_docs_from_module_file(
File
"/usr/lib/python2.4/site-packages/epydoc/docbuilder.py",
line 400, in _get_docs_from_module_file
parse_doc = parse_docs(
File
"/usr/lib/python2.4/site-packages/epydoc/docparser.py",
line 295, in parse_docs
process_file(module_doc)
File
"/usr/lib/python2.4/site-packages/epydoc/docparser.py",
line 648, in process_file
lineno, comments, decorators, encoding)
File
"/usr/lib/python2.4/site-packages/epydoc/docparser.py",
line 750, in process_line
return process_classdef(*args)
File
"/usr/lib/python2.4/site-packages/epydoc/docparser.py",
line 1497, in process_classdef
class_doc.bases.append(find_base(base_name,
parent_docs))
File
"/usr/lib/python2.4/site-packages/epydoc/docparser.py",
line 1527, in find_base
if (lookup_name(name[0], parent_docs).imported_from
not in
AttributeError: 'NoneType' object has no attribute
'imported_from'

Discussion

  • Peter Parente

    Peter Parente - 2006-04-21

    File on which epydoc blows up

     
  • Nobody/Anonymous

    Logged In: NO

    I've run into this, too, and I've found a simpler and more
    general case: it gives this error when you subclass
    something imported via "from foo import *".

    PyQt apps, for example, tend to "from qt import *" (because
    the Qt classes all begin with the letter Q, anyway -- so
    it's kind of a dealbreaker for any PyQt apps). This fails:

    from qt import *
    class Foo(QDialog): pass

    but this works:

    from qt import QDialog
    class Foo(QDialog): pass

    Note that it doesn't matter if you're not subclassing: if
    you just want to say:

    def bar(): print "QDialog is:", QDialog; return
    QDialog(None)

    it works either way you import it.

     
  • Edward Loper

    Edward Loper - 2006-08-21
    • status: open --> closed-fixed
     
  • Edward Loper

    Edward Loper - 2006-08-21

    Logged In: YES
    user_id=195958

    Thanks for the bug report.

    This should be fixed in the current subversion version
    (revision 1259).

     

Log in to post a comment.