python3.7.patch 1.2 KB

123456789101112131415161718192021222324
  1. --- orig/cx_Freeze-5.1.1/cx_Freeze/freezer.py 2017-12-09 23:11:29.000000000 +0100
  2. +++ cx_Freeze-5.1.1/cx_Freeze/freezer.py 2018-08-31 13:41:19.028655982 +0200
  3. @@ -550,13 +550,18 @@
  4. # the file is up to date so we can safely set this value to zero
  5. if module.code is not None:
  6. if module.file is not None and os.path.exists(module.file):
  7. - mtime = os.stat(module.file).st_mtime
  8. + stat = os.stat(module.file)
  9. + mtime = stat.st_mtime
  10. + size = stat.st_size & 0xFFFFFFFF
  11. else:
  12. mtime = time.time()
  13. + size = 0
  14. if sys.version_info[:2] < (3, 3):
  15. header = magic + struct.pack("<i", int(mtime))
  16. + elif sys.version_info[:2] == (3, 7):
  17. + header = magic + struct.pack("<iii",0, int(mtime), size)
  18. else:
  19. - header = magic + struct.pack("<ii", int(mtime), 0)
  20. + header = magic + struct.pack("<ii", int(mtime), size)
  21. data = header + marshal.dumps(module.code)
  22. # if the module should be written to the file system, do so