MCPcopy Create free account
hub / github.com/catboost/catboost / pymain

Function pymain

library/python/runtime/main/main.c:23–40  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

21#endif
22
23static int pymain(int argc, char** argv) {
24 const char* entry_point = getenv(env_entry_point);
25 if (entry_point && !strcmp(entry_point, ":main")) {
26 unsetenv(env_entry_point);
27 return Py_Main(argc, argv);
28 }
29 Py_InitArgcArgv(argc, argv);
30 Py_SetProgramName(argv[0]);
31 Py_Initialize();
32 PySys_SetArgv(argc, argv);
33 int rc = PyRun_SimpleString(
34 "from library.python.runtime import entry_points\n"
35 "entry_points.run_constructors()\n"
36 "import __res\n"
37 "__res.importer.run_main()\n");
38 Py_Finalize();
39 return rc == 0 ? 0 : 1;
40}
41
42int (*mainptr)(int argc, char** argv) = pymain;
43

Callers

nothing calls this directly

Calls 2

strcmpFunction · 0.85
unsetenvFunction · 0.70

Tested by

no test coverage detected