Mercurial > cpython-lru_cache-weakref
diff Python/frozenmain.c @ 1848:b724599401ff legacy-trunk
Merge back to main trunk
| author | Guido van Rossum <guido@python.org> |
|---|---|
| date | Tue, 30 Aug 1994 08:27:36 +0000 |
| parents | 4a286b300b5e |
| children | d0d0a69b5ca3 |
line wrap: on
line diff
--- a/Python/frozenmain.c Tue Aug 30 08:19:36 1994 +0000 +++ b/Python/frozenmain.c Tue Aug 30 08:27:36 1994 +0000 @@ -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 @@ 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 @@ 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; - initargs(&argc, &argv); + if (unbuffered) { + setbuf(stdout, (char *)NULL); + setbuf(stderr, (char *)NULL); + } + + if (verbose) + fprintf(stderr, "Python %s\n%s\n", + getversion(), getcopyright()); initall(); setpythonargv(argc, argv); @@ -69,3 +86,9 @@ goaway(sts); /*NOTREACHED*/ } + +char * +getprogramname() +{ + return argv0; +}
