File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 2929import shutil
3030import struct
3131import socket
32+ import struct
3233import hashlib
3334import inspect
3435import datetime
@@ -410,13 +411,8 @@ def decode_unicode_escape(value):
410411
411412# Robust bitness detection
412413# Works on Py2 & Py3, all platforms
413- try :
414- import struct
415- PyBitness = "64" if struct .calcsize ("P" ) * 8 == 64 else "32"
416- except Exception :
417- # conservative fallback
418- m = platform .machine () or ""
419- PyBitness = "64" if m .endswith ("64" ) else "32"
414+ import struct , sys
415+ PyBitness = "64" if struct .calcsize ("P" ) * 8 == 64 else ("64" if sys .maxsize > 2 ** 32 else "32" )
420416
421417geturls_ua_pyfile_python = "Mozilla/5.0 (compatible; {proname}/{prover}; +{prourl})" .format (
422418 proname = __project__ , prover = __version__ , prourl = __project_url__ )
You can’t perform that action at this time.
0 commit comments