Skip to content

Commit d0c24a8

Browse files
authored
Add files via upload
1 parent a9af515 commit d0c24a8

1 file changed

Lines changed: 10 additions & 1 deletion

File tree

pycatfile.py

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

412412
# Robust bitness detection
413-
# Works on Py2 & Py3, all platforms
413+
# Works on Py2 & Py3, all platform
414+
415+
# Python interpreter bitness
414416
PyBitness = "64" if struct.calcsize("P") * 8 == 64 else ("64" if sys.maxsize > 2**32 else "32")
415417

418+
# Operating system bitness
419+
try:
420+
OSBitness = platform.architecture()[0].replace("bit", "")
421+
except Exception:
422+
m = platform.machine().lower()
423+
OSBitness = "64" if "64" in m else "32"
424+
416425
geturls_ua_pyfile_python = "Mozilla/5.0 (compatible; {proname}/{prover}; +{prourl})".format(
417426
proname=__project__, prover=__version__, prourl=__project_url__)
418427
if(platform.python_implementation() != ""):

0 commit comments

Comments
 (0)