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):