U lf#@sdZddlZddlZddlZddlZddlZddlZddlmZ z ddl Z Wne k rddZ YnXz ddl Z Wne k rdZ YnXzddl mZWn e k rdZdZdZYnXddlZddlZddZdd Zd d Zed kredS) z'Module containing bug report helper(s).N) __version__) pyopensslcCst}|dkrt}nj|dkr\dtjjtjjtjj}tjj dkrd |tjj g}n(|dkrnt}n|dkrt}nd}||d S) aReturn a dict with the Python implementation and version. Provide both the name and the version of the Python implementation currently running. For example, on CPython 3.10.3 it will return {'name': 'CPython', 'version': '3.10.3'}. This function works best on CPython and PyPy: in particular, it probably doesn't work for Jython or IronPython. Future investigation should be done to work out the correct shape of the code for those platforms. CPythonPyPyz{}.{}.{}finalJython IronPythonUnknown)nameversion) platformpython_implementationpython_versionformatsyspypy_version_infomajorminormicro releaseleveljoin)implementationimplementation_versionr;/opt/hc_python/lib/python3.8/site-packages/requests/help.py_implementation"s&      rc Cszttd}Wntk r4ddd}YnXt}dtji}ddi}ddi}trddtji}trrdtji}ddd}t rt jt j j dd}dt t ddi}dt tddi}tj }d|dk r|dndi} ||| tdk tdk||||||dtid S) z&Generate information for a bug report.)systemreleaser r Nr)r openssl_versionxr) rr system_sslZusing_pyopensslZusing_charset_normalizerZ pyOpenSSLurllib3chardetcharset_normalizer cryptographyidnarequests)rrrOSErrorrr#rr%r$OpenSSLZSSLOPENSSL_VERSION_NUMBERgetattrr&r'sslrrequests_version) Z platform_infoZimplementation_infoZ urllib3_infoZcharset_normalizer_infoZ chardet_infoZpyopenssl_infoZcryptography_infoZ idna_infor"Zsystem_ssl_inforrrinfoEs\        r/cCsttjtddddS)z)Pretty-print the bug information as JSON.T) sort_keysindentN)printjsondumpsr/rrrrmainsr6__main__)__doc__r4rr-rr'r#rrr.r% ImportErrorr$Zurllib3.contribrr*r&rr/r6__name__rrrrs8      #;