o 7]h@sdZddlmZddlZddlZddlZddlZddlmZddlm Z ddl m Z dZ zddlmZWn ey?dZYnwzdd lmZWneyWdZdZdZYn wddlZddlZd d Zd d ZddZedkruedSdS)z'Module containing bug report helper(s).)print_functionN)idna)urllib3) __version__)chardet) pyopensslcCst}|dkr t}n5|dkr.dtjjtjjtjjf}tjjdkr-d |tjjg}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 2.7.5 it will return {'name': 'CPython', 'version': '2.7.5'}. 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%s.%s.%sfinalJython IronPythonUnknown)nameversion) platformpython_implementationpython_versionsyspypy_version_infomajorminormicro releaseleveljoin)implementationimplementation_versionr;/usr/lib/python3/dist-packages/pip/_vendor/requests/help.py_implementation s&      r c Csz ttd}Wntyddd}Ynwt}dtji}ddi}ddi}tr1dtji}tr8dtji}ddd}t rIt jdt j j d}dt t ddi}dt tddi}tj }d|dured|ndi} ||| tdutdu||||||dtid S) z&Generate information for a bug report.)systemreleaserrNr )ropenssl_versionz%xr) rr system_sslusing_pyopensslusing_charset_normalizer pyOpenSSLrrcharset_normalizer cryptographyrrequests)rr!r"IOErrorr rrr(rOpenSSLSSLOPENSSL_VERSION_NUMBERgetattrr)rsslrrequests_version) platform_infoimplementation_info urllib3_infocharset_normalizer_info chardet_infopyopenssl_infocryptography_info idna_infor$system_ssl_inforrrinfoAsZ        r;cCsttjtddddS)z)Pretty-print the bug information as JSON.T) sort_keysindentN)printjsondumpsr;rrrrmain~srB__main__)__doc__ __future__rr@rrr0 pip._vendorrrr rr1r(r ImportErrorpip._vendor.urllib3.contribrr,r)r r;rB__name__rrrrs<      !=