From b6c4ebc37aaae48b20f709bb4712921281f5006e Mon Sep 17 00:00:00 2001 From: Takeshi KOMIYA Date: Sat, 30 Jun 2018 01:43:54 +0900 Subject: [PATCH] Fix #5125: sphinx-build: Interface of ``sphinx:main()`` has changed --- CHANGES | 1 + sphinx/__init__.py | 6 +++--- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/CHANGES b/CHANGES index b860e53ed..144ac28a7 100644 --- a/CHANGES +++ b/CHANGES @@ -33,6 +33,7 @@ Bugs fixed * #5091: latex: curly braces in index entries are not handled correctly * #5070: epub: Wrong internal href fragment links * #5104: apidoc: Interface of ``sphinx.apidoc:main()`` has changed +* #5125: sphinx-build: Interface of ``sphinx:main()`` has changed Testing -------- diff --git a/sphinx/__init__.py b/sphinx/__init__.py index c81166603..34bd365bc 100644 --- a/sphinx/__init__.py +++ b/sphinx/__init__.py @@ -60,15 +60,15 @@ if __version__.endswith('+'): pass -def main(*args, **kwargs): +def main(argv=sys.argv): from .cmd import build warnings.warn( '`sphinx.main()` has moved to `sphinx.cmd.build.main()`.', RemovedInSphinx20Warning, stacklevel=2, ) - args = args[1:] # skip first argument to adjust arguments (refs: #4615) - return build.main(*args, **kwargs) + argv = argv[1:] # skip first argument to adjust arguments (refs: #4615) + return build.main(argv) def build_main(argv=sys.argv):