diff options
| author | Hannu Nyman <hannu.nyman@iki.fi> | 2017-12-31 10:56:39 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2017-12-31 10:56:39 +0200 |
| commit | 750f19ab2621ca6d8a1d0db61b8bf3daf88266b5 (patch) | |
| tree | 232b12c6a45a53aa7f198de0837feae983fe52fb /lang/python/python3/patches | |
| parent | 506c4947ae877c3bfa2eba1dedfbf94e4d531efb (diff) | |
| parent | 1b6dd4781f901a769718c49f6f255c15fd376f6e (diff) | |
Merge pull request #5303 from commodo/python-source-date-epoch
python,python3: add support for SOURCE_DATE_EPOCH var
Diffstat (limited to 'lang/python/python3/patches')
| -rw-r--r-- | lang/python/python3/patches/012-add-support-source-date-epoch-pyc.patch | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/lang/python/python3/patches/012-add-support-source-date-epoch-pyc.patch b/lang/python/python3/patches/012-add-support-source-date-epoch-pyc.patch new file mode 100644 index 000000000..4c2c2f7cd --- /dev/null +++ b/lang/python/python3/patches/012-add-support-source-date-epoch-pyc.patch @@ -0,0 +1,13 @@ +--- a/Lib/py_compile.py ++++ b/Lib/py_compile.py +@@ -137,8 +137,9 @@ def compile(file, cfile=None, dfile=None + except FileExistsError: + pass + source_stats = loader.path_stats(file) ++ mtime = int(os.getenv('SOURCE_DATE_EPOCH', source_stats['mtime'])) + bytecode = importlib._bootstrap_external._code_to_bytecode( +- code, source_stats['mtime'], source_stats['size']) ++ code, mtime, source_stats['size']) + mode = importlib._bootstrap_external._calc_mode(file) + importlib._bootstrap_external._write_atomic(cfile, bytecode, mode) + return cfile |
