Files
MINGW-packages/mingw-w64-python-cx_Freeze/0002-python37-support.patch
2018-08-05 18:02:13 +03:00

24 lines
1.2 KiB
Diff

--- cx_Freeze-5.1.1/cx_Freeze/freezer.py.orig 2018-08-05 17:52:02.652942400 +0300
+++ cx_Freeze-5.1.1/cx_Freeze/freezer.py 2018-08-05 17:53:44.557771000 +0300
@@ -550,13 +550,18 @@
# the file is up to date so we can safely set this value to zero
if module.code is not None:
if module.file is not None and os.path.exists(module.file):
- mtime = os.stat(module.file).st_mtime
+ stat = os.stat(module.file)
+ mtime = stat.st_mtime
+ size = stat.st_size & 0xFFFFFFFF
else:
mtime = time.time()
+ size = 0
if sys.version_info[:2] < (3, 3):
header = magic + struct.pack("<i", int(mtime))
- else:
+ elif sys.version_info[:2] < (3, 7):
header = magic + struct.pack("<ii", int(mtime), 0)
+ else:
+ header = magic + struct.pack("<iii", 0, int(mtime), size)
data = header + marshal.dumps(module.code)
# if the module should be written to the file system, do so