diff options
author | Guido van Rossum <guido@python.org> | 1997-07-19 19:24:41 (GMT) |
---|---|---|
committer | Guido van Rossum <guido@python.org> | 1997-07-19 19:24:41 (GMT) |
commit | 3768fb1097b0c253716b46313510c27c5afb31f9 (patch) | |
tree | 5d458ee709adc1f3b9d706c6fc8599f47893e11a /Python/frozenmain.c | |
parent | ed52aacb33623ac2e3d768ee3fcc205c6bd9046f (diff) | |
download | cpython-3768fb1097b0c253716b46313510c27c5afb31f9.zip cpython-3768fb1097b0c253716b46313510c27c5afb31f9.tar.gz cpython-3768fb1097b0c253716b46313510c27c5afb31f9.tar.bz2 |
Tracking changes to Py_Main():
- Got rid of inspection of some environment variables.
- Got rid of Py_GetProgramName() and related logic.
- Print the version header *after* successful initialization.
Diffstat (limited to 'Python/frozenmain.c')
-rw-r--r-- | Python/frozenmain.c | 22 |
1 files changed, 4 insertions, 18 deletions
diff --git a/Python/frozenmain.c b/Python/frozenmain.c index bbc165e..d693401 100644 --- a/Python/frozenmain.c +++ b/Python/frozenmain.c @@ -37,9 +37,6 @@ PERFORMANCE OF THIS SOFTWARE. extern char *Py_GetVersion(); extern char *Py_GetCopyright(); -/* For Py_GetProgramName(); set by main() */ -static char *argv0; - /* Main program */ int @@ -52,14 +49,6 @@ main(argc, argv) int inspect = 0; int unbuffered = 0; - argv0 = argv[0]; - - if ((p = getenv("PYTHONDEBUG")) && *p != '\0') - Py_DebugFlag = 1; - if ((p = getenv("PYTHONSUPPRESS")) && *p != '\0') - Py_SuppressPrintingFlag = 1; - if ((p = getenv("PYTHONVERBOSE")) && *p != '\0') - Py_VerboseFlag = 1; if ((p = getenv("PYTHONINSPECT")) && *p != '\0') inspect = 1; if ((p = getenv("PYTHONUNBUFFERED")) && *p != '\0') @@ -70,10 +59,13 @@ main(argc, argv) setbuf(stderr, (char *)NULL); } + Py_SetProgramName(argv[0]); + Py_Initialize(); + if (Py_VerboseFlag) fprintf(stderr, "Python %s\n%s\n", Py_GetVersion(), Py_GetCopyright()); - Py_Initialize(); + PySys_SetArgv(argc, argv); n = PyImport_ImportFrozenModule("__main__"); @@ -92,9 +84,3 @@ main(argc, argv) Py_Exit(sts); /*NOTREACHED*/ } - -char * -Py_GetProgramName() -{ - return argv0; -} |