Merge pull request #4853 from StevenHessing/noddos
[feed/packages.git] / lang / python / python / patches / 004-do-not-write-bytes-codes.patch
1 --- a/Python/pythonrun.c
2 +++ b/Python/pythonrun.c
3 @@ -79,7 +79,7 @@ int Py_InteractiveFlag; /* Needed by Py_
4 int Py_InspectFlag; /* Needed to determine whether to exit at SystemExit */
5 int Py_NoSiteFlag; /* Suppress 'import site' */
6 int Py_BytesWarningFlag; /* Warn on str(bytes) and str(buffer) */
7 -int Py_DontWriteBytecodeFlag; /* Suppress writing bytecode files (*.py[co]) */
8 +int Py_DontWriteBytecodeFlag = 1; /* Suppress writing bytecode files (*.py[co]) */
9 int Py_UseClassExceptionsFlag = 1; /* Needed by bltinmodule.c: deprecated */
10 int Py_FrozenFlag; /* Needed by getpath.c */
11 int Py_UnicodeFlag = 0; /* Needed by compile.c */
12 @@ -185,7 +185,7 @@ Py_InitializeEx(int install_sigs)
13 if ((p = Py_GETENV("PYTHONOPTIMIZE")) && *p != '\0')
14 Py_OptimizeFlag = add_flag(Py_OptimizeFlag, p);
15 if ((p = Py_GETENV("PYTHONDONTWRITEBYTECODE")) && *p != '\0')
16 - Py_DontWriteBytecodeFlag = add_flag(Py_DontWriteBytecodeFlag, p);
17 + Py_DontWriteBytecodeFlag = atoi(p);
18 /* The variable is only tested for existence here; _PyRandom_Init will
19 check its value further. */
20 if ((p = Py_GETENV("PYTHONHASHSEED")) && *p != '\0')