comparison Python/pythonrun.c @ 44566:599f22a349a2 legacy-trunk

Patch #602345 by Neal Norwitz and me: add -B option and PYTHONDONTWRITEBYTECODE envvar to skip writing bytecode.
author Georg Brandl <georg@python.org>
date Mon, 07 Jan 2008 17:09:35 +0000
parents 4417ab5b351e
children ea3fe302d392
comparison
equal deleted inserted replaced
44564:06d15da1f125 44566:599f22a349a2
70 int Py_DebugFlag; /* Needed by parser.c */ 70 int Py_DebugFlag; /* Needed by parser.c */
71 int Py_VerboseFlag; /* Needed by import.c */ 71 int Py_VerboseFlag; /* Needed by import.c */
72 int Py_InteractiveFlag; /* Needed by Py_FdIsInteractive() below */ 72 int Py_InteractiveFlag; /* Needed by Py_FdIsInteractive() below */
73 int Py_InspectFlag; /* Needed to determine whether to exit at SystemError */ 73 int Py_InspectFlag; /* Needed to determine whether to exit at SystemError */
74 int Py_NoSiteFlag; /* Suppress 'import site' */ 74 int Py_NoSiteFlag; /* Suppress 'import site' */
75 int Py_DontWriteBytecodeFlag; /* Suppress writing bytecode files (*.py[co]) */
75 int Py_UseClassExceptionsFlag = 1; /* Needed by bltinmodule.c: deprecated */ 76 int Py_UseClassExceptionsFlag = 1; /* Needed by bltinmodule.c: deprecated */
76 int Py_FrozenFlag; /* Needed by getpath.c */ 77 int Py_FrozenFlag; /* Needed by getpath.c */
77 int Py_UnicodeFlag = 0; /* Needed by compile.c */ 78 int Py_UnicodeFlag = 0; /* Needed by compile.c */
78 int Py_IgnoreEnvironmentFlag; /* e.g. PYTHONPATH, PYTHONHOME */ 79 int Py_IgnoreEnvironmentFlag; /* e.g. PYTHONPATH, PYTHONHOME */
79 /* _XXX Py_QnewFlag should go away in 2.3. It's true iff -Qnew is passed, 80 /* _XXX Py_QnewFlag should go away in 2.3. It's true iff -Qnew is passed,
170 Py_DebugFlag = add_flag(Py_DebugFlag, p); 171 Py_DebugFlag = add_flag(Py_DebugFlag, p);
171 if ((p = Py_GETENV("PYTHONVERBOSE")) && *p != '\0') 172 if ((p = Py_GETENV("PYTHONVERBOSE")) && *p != '\0')
172 Py_VerboseFlag = add_flag(Py_VerboseFlag, p); 173 Py_VerboseFlag = add_flag(Py_VerboseFlag, p);
173 if ((p = Py_GETENV("PYTHONOPTIMIZE")) && *p != '\0') 174 if ((p = Py_GETENV("PYTHONOPTIMIZE")) && *p != '\0')
174 Py_OptimizeFlag = add_flag(Py_OptimizeFlag, p); 175 Py_OptimizeFlag = add_flag(Py_OptimizeFlag, p);
176 if ((p = Py_GETENV("PYTHONDONTWRITEBYTECODE")) && *p != '\0')
177 Py_DontWriteBytecodeFlag = add_flag(Py_DontWriteBytecodeFlag, p);
175 178
176 interp = PyInterpreterState_New(); 179 interp = PyInterpreterState_New();
177 if (interp == NULL) 180 if (interp == NULL)
178 Py_FatalError("Py_Initialize: can't make first interpreter"); 181 Py_FatalError("Py_Initialize: can't make first interpreter");
179 182