summaryrefslogtreecommitdiffstats
path: root/Python/frozenmain.c
diff options
context:
space:
mode:
Diffstat (limited to 'Python/frozenmain.c')
-rw-r--r--Python/frozenmain.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/Python/frozenmain.c b/Python/frozenmain.c
index 769b33d..77602d7 100644
--- a/Python/frozenmain.c
+++ b/Python/frozenmain.c
@@ -2,6 +2,7 @@
/* Python interpreter main program for frozen scripts */
#include "Python.h"
+#include "internal/pystate.h"
#include <locale.h>
#ifdef MS_WINDOWS
@@ -15,6 +16,13 @@ extern int PyInitFrozenExtensions(void);
int
Py_FrozenMain(int argc, char **argv)
{
+ _PyInitError err = _PyRuntime_Initialize();
+ if (_Py_INIT_FAILED(err)) {
+ fprintf(stderr, "Fatal Python error: %s\n", err.msg);
+ fflush(stderr);
+ exit(1);
+ }
+
char *p;
int i, n, sts = 1;
int inspect = 0;