Merge pull request #5106 from tk0miya/5104_broken_apidoc_main

Fix #5104: apidoc: Interface of ``sphinx.apidoc:main()`` has changed
This commit is contained in:
Takeshi KOMIYA 2018-06-20 22:14:01 +09:00 committed by GitHub
commit e78133a83e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 3 deletions

View File

@ -32,6 +32,7 @@ Bugs fixed
* #5066: html: "relations" sidebar is not shown by default * #5066: html: "relations" sidebar is not shown by default
* #5091: latex: curly braces in index entries are not handled correctly * #5091: latex: curly braces in index entries are not handled correctly
* #5070: epub: Wrong internal href fragment links * #5070: epub: Wrong internal href fragment links
* #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 ..."