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
@@ -411,13 +412,8 @@ def decode_unicode_escape(value):
411412
412413# Robust bitness detection
413414# Works on Py2 & Py3, all platforms
414- try :
415- import struct
416- PyBitness = "64" if struct .calcsize ("P" ) * 8 == 64 else "32"
417- except Exception :
418- # conservative fallback
419- m = platform .machine () or ""
420- PyBitness = "64" if m .endswith ("64" ) else "32"
415+ import struct , sys
416+ PyBitness = "64" if struct .calcsize ("P" ) * 8 == 64 else ("64" if sys .maxsize > 2 ** 32 else "32" )
421417
422418geturls_ua_pyfile_python = "Mozilla/5.0 (compatible; {proname}/{prover}; +{prourl})" .format (
423419 proname = __project__ , prover = __version__ , prourl = __project_url__ )
You can’t perform that action at this time.
0 commit comments