diff options
author | Guido van Rossum <guido@python.org> | 1997-07-19 19:24:41 +0000 |
---|---|---|
committer | Guido van Rossum <guido@python.org> | 1997-07-19 19:24:41 +0000 |
commit | 92cdd19f8150e97b2cc2dd2bc4ec8ac559873709 (patch) | |
tree | c730441280dcdb198afb98f74f5982e09ef6bd83 /Python/frozenmain.c | |
parent | bca463a8a95d192c16d7d26a3ec346dda0ca39b9 (diff) | |
download | cpython-92cdd19f8150e97b2cc2dd2bc4ec8ac559873709.tar.gz |
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 bbc165e999..d693401188 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; -} |