Skip to content

Commit dc2aac4

Browse files
authored
Add files via upload
1 parent 852e3f7 commit dc2aac4

1 file changed

Lines changed: 10 additions & 1 deletion

File tree

pyarchivefile.py

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -397,9 +397,18 @@ def decode_unicode_escape(value):
397397
__version__ = str(__version_info__[0]) + "." + str(__version_info__[1]) + "." + str(__version_info__[2])
398398

399399
# Robust bitness detection
400-
# Works on Py2 & Py3, all platforms
400+
# Works on Py2 & Py3, all platform
401+
402+
# Python interpreter bitness
401403
PyBitness = "64" if struct.calcsize("P") * 8 == 64 else ("64" if sys.maxsize > 2**32 else "32")
402404

405+
# Operating system bitness
406+
try:
407+
OSBitness = platform.architecture()[0].replace("bit", "")
408+
except Exception:
409+
m = platform.machine().lower()
410+
OSBitness = "64" if "64" in m else "32"
411+
403412
geturls_ua_pyfile_python = "Mozilla/5.0 (compatible; {proname}/{prover}; +{prourl})".format(
404413
proname=__project__, prover=__version__, prourl=__project_url__)
405414
if(platform.python_implementation() != ""):

0 commit comments

Comments
 (0)