MCPcopy Index your code
hub / github.com/python/cpython / main

Function main

Platforms/Apple/__main__.py:1060–1098  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

1058
1059
1060def main() -> None:
1061 # Handle SIGTERM the same way as SIGINT. This ensures that if we're
1062 # terminated by the buildbot worker, we'll make an attempt to clean up our
1063 # subprocesses.
1064 def signal_handler(*args):
1065 os.kill(os.getpid(), signal.SIGINT)
1066
1067 signal.signal(signal.SIGTERM, signal_handler)
1068
1069 # Process command line arguments
1070 context = parse_args()
1071
1072 # Set the CROSS_BUILD_DIR if an argument was provided
1073 if context.cross_build_dir:
1074 global CROSS_BUILD_DIR
1075 CROSS_BUILD_DIR = context.cross_build_dir.resolve()
1076
1077 dispatch: dict[str, Callable] = {
1078 "clean": clean,
1079 "configure-build": configure_build_python,
1080 "make-build": make_build_python,
1081 "configure-host": configure_host_python,
1082 "make-host": make_host_python,
1083 "package": package,
1084 "build": build,
1085 "test": test,
1086 "ci": ci,
1087 }
1088
1089 try:
1090 dispatch[context.subcommand](context)
1091 except CalledProcessError as e:
1092 print()
1093 print_called_process_error(e)
1094 sys.exit(1)
1095 except RuntimeError as e:
1096 print()
1097 print(e)
1098 sys.exit(2)
1099
1100
1101if __name__ == "__main__":

Callers 1

__main__.pyFile · 0.70

Calls 4

parse_argsFunction · 0.70
resolveMethod · 0.45
exitMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…