diff options
Diffstat (limited to 'Python/frozenmain.c')
-rw-r--r-- | Python/frozenmain.c | 33 |
1 files changed, 28 insertions, 5 deletions
diff --git a/Python/frozenmain.c b/Python/frozenmain.c index 8f35ea5..20d0364 100644 --- a/Python/frozenmain.c +++ b/Python/frozenmain.c @@ -1,5 +1,5 @@ /*********************************************************** -Copyright 1991, 1992, 1993 by Stichting Mathematisch Centrum, +Copyright 1991, 1992, 1993, 1994 by Stichting Mathematisch Centrum, Amsterdam, The Netherlands. All Rights Reserved @@ -28,9 +28,14 @@ OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. extern char *getenv(); +extern char *getversion(); +extern char *getcopyright(); + extern int debugging; extern int verbose; -extern int killprint; +extern int suppress_print; + +static char *argv0; main(argc, argv) int argc; @@ -39,17 +44,29 @@ main(argc, argv) char *p; int n, sts; int inspect = 0; + int unbuffered = 0; + + argv0 = argv[0]; if ((p = getenv("PYTHONDEBUG")) && *p != '\0') debugging = 1; + if ((p = getenv("PYTHONSUPPRESS")) && *p != '\0') + suppress_print = 1; if ((p = getenv("PYTHONVERBOSE")) && *p != '\0') verbose = 1; if ((p = getenv("PYTHONINSPECT")) && *p != '\0') inspect = 1; - if ((p = getenv("PYTHONKILLPRINT")) && *p != '\0') - killprint = 1; + if ((p = getenv("PYTHONUNBUFFERED")) && *p != '\0') + unbuffered = 1; + + if (unbuffered) { + setbuf(stdout, (char *)NULL); + setbuf(stderr, (char *)NULL); + } - initargs(&argc, &argv); + if (verbose) + fprintf(stderr, "Python %s\n%s\n", + getversion(), getcopyright()); initall(); setpythonargv(argc, argv); @@ -69,3 +86,9 @@ main(argc, argv) goaway(sts); /*NOTREACHED*/ } + +char * +getprogramname() +{ + return argv0; +} |