1
1
/* Python interpreter main program for frozen scripts */
2
2
3
3
#include "Python.h"
4
- #include "pycore_pystate.h" // _Py_GetConfig()
5
- #include "pycore_runtime.h" // _PyRuntime_Initialize()
4
+ #include "pycore_pystate.h" // _PyInterpreterState_SetRunningMain()
6
5
7
6
#ifdef HAVE_UNISTD_H
8
7
# include <unistd.h> // isatty()
@@ -20,19 +19,14 @@ extern int PyInitFrozenExtensions(void);
20
19
int
21
20
Py_FrozenMain (int argc , char * * argv )
22
21
{
23
- PyStatus status = _PyRuntime_Initialize ();
24
- if (PyStatus_Exception (status )) {
25
- Py_ExitStatusException (status );
26
- }
27
-
28
22
PyConfig config ;
29
23
PyConfig_InitPythonConfig (& config );
30
24
// Suppress errors from getpath.c
31
25
config .pathconfig_warnings = 0 ;
32
26
// Don't parse command line options like -E
33
27
config .parse_argv = 0 ;
34
28
35
- status = PyConfig_SetBytesArgv (& config , argc , argv );
29
+ PyStatus status = PyConfig_SetBytesArgv (& config , argc , argv );
36
30
if (PyStatus_Exception (status )) {
37
31
PyConfig_Clear (& config );
38
32
Py_ExitStatusException (status );
@@ -64,7 +58,12 @@ Py_FrozenMain(int argc, char **argv)
64
58
PyWinFreeze_ExeInit ();
65
59
#endif
66
60
67
- if (_Py_GetConfig ()-> verbose ) {
61
+ int verbose ;
62
+ if (PyConfig_GetInt ("verbose" , & verbose ) < 0 ) {
63
+ verbose = 0 ;
64
+ PyErr_Clear ();
65
+ }
66
+ if (verbose ) {
68
67
fprintf (stderr , "Python %s\n%s\n" ,
69
68
Py_GetVersion (), Py_GetCopyright ());
70
69
}
0 commit comments