o {nh#@sdZddlZddlZddlZddlZddlZddlZddlmZ zddl Z Wn e y1dZ Ynwzddl Z Wn e yCdZ Ynwzddl mZWne y[dZdZdZYn wddlZddlZddZdd Zd d Zed kryedSdS) z'Module containing bug report helper(s).N) __version__) pyopensslcCst}|dkr t}n5|dkr.dtjjtjjtjj}tjj dkr-d |tjj g}n|dkr7t}n |dkr@t}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_versionr8/usr/local/lib/python3.10/dist-packages/requests/help.py_implementation"s(       rc Csz ttd}Wntyddd}Ynwt}dtji}ddi}ddi}tr1dtji}tr8dtji}ddd}t rIt jt j j dd}dt t ddi}dt tddi}tj }d|dure|dndi} ||| tdutdu||||||dtid S) z&Generate information for a bug report.)systemreleaser r Nr)r openssl_versionxr) rr system_sslusing_pyopensslusing_charset_normalizer pyOpenSSLurllib3chardetcharset_normalizer cryptographyidnarequests)rrrOSErrorrr&rr(r'OpenSSLSSLOPENSSL_VERSION_NUMBERgetattrr)r*sslrrequests_version) platform_infoimplementation_info urllib3_infocharset_normalizer_info chardet_infopyopenssl_infocryptography_info idna_infor"system_ssl_inforrrinfoEsX        r<cCsttjtddddS)z)Pretty-print the bug information as JSON.T) sort_keysindentN)printjsondumpsr<rrrrmainsrC__main__)__doc__rArr1rr*r&rrr2r( ImportErrorr'urllib3.contribrr-r)rr<rC__name__rrrrsB      #;