Fix #5125: sphinx-build: Interface of `sphinx:main()` has changed

This commit is contained in:
Takeshi KOMIYA 2018-06-30 01:43:54 +09:00
parent e78133a83e
commit b6c4ebc37a
2 changed files with 4 additions and 3 deletions

View File

@ -33,6 +33,7 @@ Bugs fixed
* #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 * #5104: apidoc: Interface of ``sphinx.apidoc:main()`` has changed
* #5125: sphinx-build: Interface of ``sphinx:main()`` has changed
Testing Testing
-------- --------

View File

@ -60,15 +60,15 @@ if __version__.endswith('+'):
pass pass
def main(*args, **kwargs): def main(argv=sys.argv):
from .cmd import build from .cmd import build
warnings.warn( warnings.warn(
'`sphinx.main()` has moved to `sphinx.cmd.build.main()`.', '`sphinx.main()` has moved to `sphinx.cmd.build.main()`.',
RemovedInSphinx20Warning, RemovedInSphinx20Warning,
stacklevel=2, stacklevel=2,
) )
args = args[1:] # skip first argument to adjust arguments (refs: #4615) argv = argv[1:] # skip first argument to adjust arguments (refs: #4615)
return build.main(*args, **kwargs) return build.main(argv)
def build_main(argv=sys.argv): def build_main(argv=sys.argv):