mirror of
https://github.com/python/cpython.git
synced 2025-09-26 18:29:57 +00:00
renaming phase 3
This commit is contained in:
parent
2ddd978fcc
commit
4e2e0f9225
1 changed files with 15 additions and 15 deletions
|
@ -24,16 +24,16 @@ OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
||||||
|
|
||||||
/* Python interpreter main program for frozen scripts */
|
/* Python interpreter main program for frozen scripts */
|
||||||
|
|
||||||
#include "allobjects.h"
|
#include "Python.h"
|
||||||
|
|
||||||
extern char *getenv();
|
extern char *getenv();
|
||||||
|
|
||||||
extern char *getversion();
|
extern char *getversion();
|
||||||
extern char *getcopyright();
|
extern char *getcopyright();
|
||||||
|
|
||||||
extern int debugging;
|
extern int Py_DebugFlag;
|
||||||
extern int verbose;
|
extern int Py_VerboseFlag;
|
||||||
extern int suppress_print;
|
extern int Py_SuppressPrintingFlag;
|
||||||
|
|
||||||
static char *argv0;
|
static char *argv0;
|
||||||
|
|
||||||
|
@ -49,11 +49,11 @@ main(argc, argv)
|
||||||
argv0 = argv[0];
|
argv0 = argv[0];
|
||||||
|
|
||||||
if ((p = getenv("PYTHONDEBUG")) && *p != '\0')
|
if ((p = getenv("PYTHONDEBUG")) && *p != '\0')
|
||||||
debugging = 1;
|
Py_DebugFlag = 1;
|
||||||
if ((p = getenv("PYTHONSUPPRESS")) && *p != '\0')
|
if ((p = getenv("PYTHONSUPPRESS")) && *p != '\0')
|
||||||
suppress_print = 1;
|
Py_SuppressPrintingFlag = 1;
|
||||||
if ((p = getenv("PYTHONVERBOSE")) && *p != '\0')
|
if ((p = getenv("PYTHONVERBOSE")) && *p != '\0')
|
||||||
verbose = 1;
|
Py_VerboseFlag = 1;
|
||||||
if ((p = getenv("PYTHONINSPECT")) && *p != '\0')
|
if ((p = getenv("PYTHONINSPECT")) && *p != '\0')
|
||||||
inspect = 1;
|
inspect = 1;
|
||||||
if ((p = getenv("PYTHONUNBUFFERED")) && *p != '\0')
|
if ((p = getenv("PYTHONUNBUFFERED")) && *p != '\0')
|
||||||
|
@ -64,26 +64,26 @@ main(argc, argv)
|
||||||
setbuf(stderr, (char *)NULL);
|
setbuf(stderr, (char *)NULL);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (verbose)
|
if (Py_VerboseFlag)
|
||||||
fprintf(stderr, "Python %s\n%s\n",
|
fprintf(stderr, "Python %s\n%s\n",
|
||||||
getversion(), getcopyright());
|
getversion(), getcopyright());
|
||||||
initall();
|
Py_Initialize();
|
||||||
setpythonargv(argc, argv);
|
PySys_SetArgv(argc, argv);
|
||||||
|
|
||||||
n = init_frozen("__main__");
|
n = PyImport_ImportFrozenModule("__main__");
|
||||||
if (n == 0)
|
if (n == 0)
|
||||||
fatal("__main__ not frozen");
|
Py_FatalError("__main__ not frozen");
|
||||||
if (n < 0) {
|
if (n < 0) {
|
||||||
print_error();
|
PyErr_Print();
|
||||||
sts = 1;
|
sts = 1;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
sts = 0;
|
sts = 0;
|
||||||
|
|
||||||
if (inspect && isatty((int)fileno(stdin)))
|
if (inspect && isatty((int)fileno(stdin)))
|
||||||
sts = run(stdin, "<stdin>") != 0;
|
sts = PyRun_AnyFile(stdin, "<stdin>") != 0;
|
||||||
|
|
||||||
goaway(sts);
|
Py_Exit(sts);
|
||||||
/*NOTREACHED*/
|
/*NOTREACHED*/
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue