-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtelit862-python-crosscompile-fix.patch
45 lines (43 loc) · 1.28 KB
/
telit862-python-crosscompile-fix.patch
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
*** /Users/kzar/Desktop/py_compile.py 2011-05-22 16:34:31.000000000 +0100
--- /Users/kzar/.wine/drive_c/Program Files/Python/Lib/py_compile.py 2007-01-22 10:19:16.000000000 +0000
***************
*** 45,50 ****
--- 45,54 ----
"""
import os, marshal, __builtin__
f = open(file)
+ try:
+ timestamp = long(os.fstat(f.fileno())[8])
+ except AttributeError:
+ timestamp = long(os.stat(file)[8])
codestring = f.read()
f.close()
if codestring and codestring[-1] != '\n':
***************
*** 119,125 ****
cfile = ""
cfile = file + (__debug__ and 'c' or 'o')
fc = open(cfile, 'wb')
! fc.write('\0\0\0\0\xFF\xFF\xFF\xFF')
marshal.dump(codeobject, fc)
fc.flush()
fc.seek(0, 0)
--- 123,130 ----
cfile = ""
cfile = file + (__debug__ and 'c' or 'o')
fc = open(cfile, 'wb')
! fc.write('\0\0\0\0')
! wr_long(fc, timestamp)
marshal.dump(codeobject, fc)
fc.flush()
fc.seek(0, 0)
***************
*** 132,135 ****
return 0
if __name__ == "__main__":
! compile(sys.argv[1])
--- 137,140 ----
return 0
if __name__ == "__main__":
! compile(sys.argv[1])
\ No newline at end of file