summaryrefslogtreecommitdiff
path: root/Python/pythonrun.c
diff options
context:
space:
mode:
authorGeorg Brandl <georg@python.org>2008-01-07 17:09:35 +0000
committerGeorg Brandl <georg@python.org>2008-01-07 17:09:35 +0000
commit3e00689e7a4db823206317b9027b809faaab1e7f (patch)
tree4481095cddf6893ec49123477d1f20a0682b6825 /Python/pythonrun.c
parentf9307f8707dfa32fc15e67617794bd0ef3dacb0a (diff)
downloadcpython-3e00689e7a4db823206317b9027b809faaab1e7f.tar.gz
Patch #602345 by Neal Norwitz and me: add -B option and PYTHONDONTWRITEBYTECODE envvar to skip writing bytecode.
Diffstat (limited to 'Python/pythonrun.c')
-rw-r--r--Python/pythonrun.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/Python/pythonrun.c b/Python/pythonrun.c
index adae679057..4939f54890 100644
--- a/Python/pythonrun.c
+++ b/Python/pythonrun.c
@@ -72,6 +72,7 @@ int Py_VerboseFlag; /* Needed by import.c */
int Py_InteractiveFlag; /* Needed by Py_FdIsInteractive() below */
int Py_InspectFlag; /* Needed to determine whether to exit at SystemError */
int Py_NoSiteFlag; /* Suppress 'import site' */
+int Py_DontWriteBytecodeFlag; /* Suppress writing bytecode files (*.py[co]) */
int Py_UseClassExceptionsFlag = 1; /* Needed by bltinmodule.c: deprecated */
int Py_FrozenFlag; /* Needed by getpath.c */
int Py_UnicodeFlag = 0; /* Needed by compile.c */
@@ -172,6 +173,8 @@ Py_InitializeEx(int install_sigs)
Py_VerboseFlag = add_flag(Py_VerboseFlag, p);
if ((p = Py_GETENV("PYTHONOPTIMIZE")) && *p != '\0')
Py_OptimizeFlag = add_flag(Py_OptimizeFlag, p);
+ if ((p = Py_GETENV("PYTHONDONTWRITEBYTECODE")) && *p != '\0')
+ Py_DontWriteBytecodeFlag = add_flag(Py_DontWriteBytecodeFlag, p);
interp = PyInterpreterState_New();
if (interp == NULL)