Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitcc5e153

Browse files
authored
Ensure exit status is returned bybuild_docs.py (#286)
1 parent982c0f8 commitcc5e153

File tree

1 file changed

+13
-12
lines changed

1 file changed

+13
-12
lines changed

‎build_docs.py

Lines changed: 13 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -911,20 +911,21 @@ def _checkout_name(select_output: str | None) -> str:
911911
return"cpython"
912912

913913

914-
defmain()->None:
914+
defmain()->int:
915915
"""Script entry point."""
916916
args=parse_args()
917917
setup_logging(args.log_directory,args.select_output)
918918
load_environment_variables()
919919

920920
ifargs.select_outputisNone:
921-
build_docs_with_lock(args,"build_docs.lock")
922-
elifargs.select_output=="no-html":
923-
build_docs_with_lock(args,"build_docs_archives.lock")
924-
elifargs.select_output=="only-html":
925-
build_docs_with_lock(args,"build_docs_html.lock")
926-
elifargs.select_output=="only-html-en":
927-
build_docs_with_lock(args,"build_docs_html_en.lock")
921+
returnbuild_docs_with_lock(args,"build_docs.lock")
922+
ifargs.select_output=="no-html":
923+
returnbuild_docs_with_lock(args,"build_docs_archives.lock")
924+
ifargs.select_output=="only-html":
925+
returnbuild_docs_with_lock(args,"build_docs_html.lock")
926+
ifargs.select_output=="only-html-en":
927+
returnbuild_docs_with_lock(args,"build_docs_html_en.lock")
928+
returnEX_FAILURE
928929

929930

930931
defparse_args()->argparse.Namespace:
@@ -1073,12 +1074,12 @@ def build_docs_with_lock(args: argparse.Namespace, lockfile_name: str) -> int:
10731074
returnEX_FAILURE
10741075

10751076
try:
1076-
returnEX_OKifbuild_docs(args)elseEX_FAILURE
1077+
returnbuild_docs(args)
10771078
finally:
10781079
lock.close()
10791080

10801081

1081-
defbuild_docs(args:argparse.Namespace)->bool:
1082+
defbuild_docs(args:argparse.Namespace)->int:
10821083
"""Build all docs (each language and each version)."""
10831084
logging.info("Full build start.")
10841085
start_time=perf_counter()
@@ -1159,7 +1160,7 @@ def build_docs(args: argparse.Namespace) -> bool:
11591160

11601161
logging.info("Full build done (%s).",format_seconds(perf_counter()-start_time))
11611162

1162-
returnany_build_failed
1163+
returnEX_FAILUREifany_build_failedelseEX_OK
11631164

11641165

11651166
defparse_versions_from_devguide(http:urllib3.PoolManager)->Versions:
@@ -1397,4 +1398,4 @@ def purge_surrogate_key(http: urllib3.PoolManager, surrogate_key: str) -> None:
13971398

13981399

13991400
if__name__=="__main__":
1400-
sys.exit(main())
1401+
raiseSystemExit(main())

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp