Skip to content

Commit 1c519b8

Browse files
authored
Add files via upload
1 parent 9d7e4d6 commit 1c519b8

File tree

1 file changed

+2
-7
lines changed

1 file changed

+2
-7
lines changed

pyarchivefile.py

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@
2929
import shutil
3030
import struct
3131
import socket
32+
import struct
3233
import hashlib
3334
import inspect
3435
import datetime
@@ -398,13 +399,7 @@ def decode_unicode_escape(value):
398399

399400
# Robust bitness detection
400401
# Works on Py2 & Py3, all platforms
401-
try:
402-
import struct
403-
PyBitness = "64" if struct.calcsize("P") * 8 == 64 else "32"
404-
except Exception:
405-
# conservative fallback
406-
m = platform.machine() or ""
407-
PyBitness = "64" if m.endswith("64") else "32"
402+
PyBitness = "64" if struct.calcsize("P") * 8 == 64 else ("64" if sys.maxsize > 2**32 else "32")
408403

409404
geturls_ua_pyfile_python = "Mozilla/5.0 (compatible; {proname}/{prover}; +{prourl})".format(
410405
proname=__project__, prover=__version__, prourl=__project_url__)

0 commit comments

Comments
 (0)