3 ig@sdZddlmZddlZddlZddlZddlZddlmZddlm Z ddl m Z dZ yddlmZWnek rdZYnXydd lmZWn ek rdZdZdZYnXddlZddlZd d Zd d ZddZedkredS)z'Module containing bug report helper(s).)print_functionN)idna)urllib3) __version__)chardet) pyopensslcCstj}|dkrtj}nj|dkr\dtjjtjjtjjf}tjjdkrdj |tjjg}n(|dkrntj}n|dkrtj}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_versionr8/tmp/pip-build-88gy_88q/pip/pip/_vendor/requests/help.py_implementation s      r c Csytjtjd}Wntk r4ddd}YnXt}dtji}ddi}ddi}trddtji}trrdtji}ddd}t rt jdt j j d}dt t ddi}dt tddi}tj }d|dk rd|ndi} ||| tdk tdk||||||dtid S) z&Generate information for a bug report.)systemreleaserrNr )ropenssl_versionz%xr) rr system_sslZusing_pyopensslZusing_charset_normalizerZ pyOpenSSLrrcharset_normalizer cryptographyrrequests)rr!r"IOErrorr rrr%rOpenSSLZSSLOPENSSL_VERSION_NUMBERgetattrr&rsslrrequests_version) Z platform_infoZimplementation_infoZ urllib3_infoZcharset_normalizer_infoZ chardet_infoZpyopenssl_infoZcryptography_infoZ idna_infor$Zsystem_ssl_inforrrinfoAsF   r.cCsttjtddddS)z)Pretty-print the bug information as JSON.T) sort_keysindentN)printjsondumpsr.rrrrmain~sr5__main__)__doc__ __future__rr3rrr, pip._vendorrrr rr-r%r ImportErrorZpip._vendor.urllib3.contribrr)r&r r.r5__name__rrrrs4      !=