You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

13 lines
594 B

  1. --- a/Lib/py_compile.py
  2. +++ b/Lib/py_compile.py
  3. @@ -137,8 +137,9 @@ def compile(file, cfile=None, dfile=None
  4. except FileExistsError:
  5. pass
  6. source_stats = loader.path_stats(file)
  7. + mtime = int(os.getenv('SOURCE_DATE_EPOCH', source_stats['mtime']))
  8. bytecode = importlib._bootstrap_external._code_to_bytecode(
  9. - code, source_stats['mtime'], source_stats['size'])
  10. + code, mtime, source_stats['size'])
  11. mode = importlib._bootstrap_external._calc_mode(file)
  12. importlib._bootstrap_external._write_atomic(cfile, bytecode, mode)
  13. return cfile