Issues

Issue #740 wontfix

autodoc crashes when encounters option parser

Anonymous created an issue

"make html" reports build error: {{{

!bash

sphinx-build: error: no such option: -b }}}

when autodoc encounters following line:

{{{

!python

(options, args) = parser.parse_args() }}}

parser is the OptionParser from optparse module.

Wider bug description here: http://stackoverflow.com/questions/6912025/is-optionparser-in-conflict-with-sphinx

Comments (3)

  1. Georg Brandl repo owner

    As suggested in the stackoverflow issue, don't unconditionally run code on import in the modules you autodoc.

    Rather use a if __name__ == '__main__': clause to run your "script code".

  2. Log in to comment