Fix potential wrong-over-optimization in math utilities
[carla.git] / data / patches / cxfreeze-py37.patch
blob365ee8eafa07035807bbb6bc200c6f961cfe27d9
1 From 76542754e01d2d4b21c6744c563dda8d5c72b3b2 Mon Sep 17 00:00:00 2001
2 From: egormartiniuc <egor.martiniuc@gmail.com>
3 Date: Tue, 3 Jul 2018 16:38:06 +0200
4 Subject: [PATCH] Update freezer.py
6 python 3.7.0 64Bit
7 ---
8 cx_Freeze/freezer.py | 10 ++++++++--
9 1 file changed, 8 insertions(+), 2 deletions(-)
11 diff --git a/cx_Freeze/freezer.py b/cx_Freeze/freezer.py
12 index 27a78c2..cfcc3b4 100644
13 --- a/cx_Freeze/freezer.py
14 +++ b/cx_Freeze/freezer.py
15 @@ -555,10 +555,16 @@ def _WriteModules(self, fileName, finder):
16 # the file is up to date so we can safely set this value to zero
17 if module.code is not None:
18 if module.file is not None and os.path.exists(module.file):
19 - mtime = os.stat(module.file).st_mtime
20 + stat = os.stat(module.file)
21 + mtime = stat.st_mtime
22 + size = stat.st_size & 0xFFFFFFFF
23 else:
24 mtime = time.time()
25 - header = magic + struct.pack("<ii", int(mtime), 0)
26 + size = 0
27 + if sys.version_info[:2] == (3, 7):
28 + header = magic + struct.pack("<iii", 0, int(mtime), size)
29 + else:
30 + header = magic + struct.pack("<ii", int(mtime), size)
31 data = header + marshal.dumps(module.code)
33 # if the module should be written to the file system, do so