2 /* Python interpreter main program for frozen scripts */
7 extern void PyWinFreeze_ExeInit(void);
8 extern void PyWinFreeze_ExeTerm(void);
9 extern int PyInitFrozenExtensions(void);
15 Py_FrozenMain(int argc
, char **argv
)
22 Py_FrozenFlag
= 1; /* Suppress errors from getpath.c */
24 if ((p
= Py_GETENV("PYTHONINSPECT")) && *p
!= '\0')
26 if ((p
= Py_GETENV("PYTHONUNBUFFERED")) && *p
!= '\0')
30 setbuf(stdin
, (char *)NULL
);
31 setbuf(stdout
, (char *)NULL
);
32 setbuf(stderr
, (char *)NULL
);
36 PyInitFrozenExtensions();
37 #endif /* MS_WINDOWS */
38 Py_SetProgramName(argv
[0]);
41 PyWinFreeze_ExeInit();
45 fprintf(stderr
, "Python %s\n%s\n",
46 Py_GetVersion(), Py_GetCopyright());
48 PySys_SetArgv(argc
, argv
);
50 n
= PyImport_ImportFrozenModule("__main__");
52 Py_FatalError("__main__ not frozen");
60 if (inspect
&& isatty((int)fileno(stdin
)))
61 sts
= PyRun_AnyFile(stdin
, "<stdin>") != 0;
64 PyWinFreeze_ExeTerm();