Skip to content

Commit 28f8881

Browse files
committed
Fix darwin pack issue
1 parent 31982c4 commit 28f8881

2 files changed

Lines changed: 4 additions & 1 deletion

File tree

src/protect_code2.pt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,9 @@ def protect_pytransform():
2222
with open(filename, 'rb') as f:
2323
buf = bytearray(f.read())
2424
value = sum(buf)
25+
sys = __import__('sys')
26+
if hasattr(sys, 'frozen') and sys.platform == 'darwin':
27+
value += 4100
2528
if value not in {checklist}:
2629
raise RuntimeError('unexpected %s' % filename)
2730

src/utils.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1203,7 +1203,7 @@ def _make_super_runtime(capsule, output, licfile=None, platforms=None,
12031203

12041204
with open(target, 'wb') as f:
12051205
f.write(data)
1206-
checklist.append(sum(data))
1206+
checklist.append(sum(bytearray(data)))
12071207

12081208
logging.info('Generate runtime files OK')
12091209
return checklist

0 commit comments

Comments
 (0)