Fix #5104: apidoc: Interface of `sphinx.apidoc:main()` has changed

This commit is contained in:
Takeshi KOMIYA 2018-06-18 21:48:03 +09:00
parent 62b6d209dc
commit a61986256a
2 changed files with 4 additions and 3 deletions

View File

@ -29,6 +29,7 @@ Bugs fixed
* #5019: autodoc: crashed by Form Feed Character * #5019: autodoc: crashed by Form Feed Character
* #5032: autodoc: loses the first staticmethod parameter for old styled classes * #5032: autodoc: loses the first staticmethod parameter for old styled classes
* #5036: quickstart: Typing Ctrl-U clears the whole of line * #5036: quickstart: Typing Ctrl-U clears the whole of line
* #5104: apidoc: Interface of ``sphinx.apidoc:main()`` has changed
Testing Testing
-------- --------

View File

@ -9,20 +9,20 @@
:license: BSD, see LICENSE for details. :license: BSD, see LICENSE for details.
""" """
import sys
import warnings import warnings
from sphinx.deprecation import RemovedInSphinx20Warning from sphinx.deprecation import RemovedInSphinx20Warning
from sphinx.ext.apidoc import main as _main from sphinx.ext.apidoc import main as _main
def main(*args, **kwargs): def main(argv=sys.argv):
warnings.warn( warnings.warn(
'`sphinx.apidoc.main()` has moved to `sphinx.ext.apidoc.main()`.', '`sphinx.apidoc.main()` has moved to `sphinx.ext.apidoc.main()`.',
RemovedInSphinx20Warning, RemovedInSphinx20Warning,
stacklevel=2, stacklevel=2,
) )
args = args[1:] # skip first argument to adjust arguments (refs: #4615) _main(argv[1:]) # skip first argument to adjust arguments (refs: #4615)
_main(*args, **kwargs)
# So program can be started with "python -m sphinx.apidoc ..." # So program can be started with "python -m sphinx.apidoc ..."