diff options
| author | Alexandru Ardelean <aa@ocedo.com> | 2014-12-09 14:14:08 +0200 |
|---|---|---|
| committer | Alexandru Ardelean <aa@ocedo.com> | 2014-12-09 14:16:03 +0200 |
| commit | 48aaf1805792ea8b5cba5b1094e8a89cec85b7db (patch) | |
| tree | 5192b8e93f73e07283feb865d7ee38025e131e07 /lang/python3 | |
| parent | 81545ba2814eb23f4fda78565f2d2de892c8ad18 (diff) | |
python3: disable Python3 bytecode generation by default
Same as python.
Signed-off-by: Alexandru Ardelean <ardeleanalex@gmail.com>
Diffstat (limited to 'lang/python3')
| -rw-r--r-- | lang/python3/patches/140-do-not-write-bytes-codes.patch | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/lang/python3/patches/140-do-not-write-bytes-codes.patch b/lang/python3/patches/140-do-not-write-bytes-codes.patch new file mode 100644 index 000000000..f624d5862 --- /dev/null +++ b/lang/python3/patches/140-do-not-write-bytes-codes.patch @@ -0,0 +1,22 @@ +diff --git a/Python/pythonrun.c b/Python/pythonrun.c +index 0327830..df41cda 100644 +--- a/Python/pythonrun.c ++++ b/Python/pythonrun.c +@@ -124,7 +124,7 @@ int Py_InteractiveFlag; /* Needed by Py_FdIsInteractive() below */ + int Py_InspectFlag; /* Needed to determine whether to exit at SystemExit */ + int Py_NoSiteFlag; /* Suppress 'import site' */ + int Py_BytesWarningFlag; /* Warn on str(bytes) and str(buffer) */ +-int Py_DontWriteBytecodeFlag; /* Suppress writing bytecode files (*.py[co]) */ ++int Py_DontWriteBytecodeFlag = 1; /* Suppress writing bytecode files (*.py[co]) */ + int Py_UseClassExceptionsFlag = 1; /* Needed by bltinmodule.c: deprecated */ + int Py_FrozenFlag; /* Needed by getpath.c */ + int Py_IgnoreEnvironmentFlag; /* e.g. PYTHONPATH, PYTHONHOME */ +@@ -350,7 +350,7 @@ _Py_InitializeEx_Private(int install_sigs, int install_importlib) + 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); ++ Py_DontWriteBytecodeFlag = atoi(p); + /* The variable is only tested for existence here; _PyRandom_Init will + check its value further. */ + if ((p = Py_GETENV("PYTHONHASHSEED")) && *p != '\0') |
