When I load my code into epydoc
and just load the top module it fails with:
Error: TypeError: 'NoneType' object is not callable (line 10)
Where the the NoneType
that it is referring to is a submodule that I tried to load on line 9. How can I get epydoc to explain why it couldn't load the module on line 9 instead of just plowing ahead and hitting an error?
Per nosko's request. Here is similar example, where no stack trace is given:
# foo.py
import bar
bar.baz()
# bar.py
def baz():
print 'baz'
import os
os.environ['DOES_NOT_EXIST']
Run with:
python2.6 epydoc --html foo.py
Produces the less than useful:
+-------------------------------------- | In /home/ross/foo.py: | Import failed (but source code parsing was successful). | Error: KeyError: 'DOES_NOT_EXIST' (line 1)I want epydoc to tell me that the failure is on line 6 of
bar.py
. I don't want it to complain about foo.py
's import of bar.py
. I can't reproduce my specific problem in a small example, but my fundamental request is that when epydoc fails, I want it to print a stack trace to point to the issue. Whether it is loading a sub-module or calling not finding a key in a dictionary.
NOTE: The root of this problem is that the code I am trying to document is an input to SCons which has different environment setup issues. That's why when I run in epydoc
it doesn't work, but the script still works when run with scons -f SConstruct.py
. I'm also trying to generate documentation with sphinx
. When I run with sphinx
it actually shows the stack trace. Maybe I'll go with sphinx
...