a Ba_ @sdZddlmZddlZddlZddlZddlZddlZddlZddl Z ddl m Z zddl mZWneydZdZdZYn0ddlZddlZddZd d Zd d Zed kredS)z'Module containing bug report helper(s).)print_functionN) __version__) pyopensslcCst}|dkrt}nj|dkr\dtjjtjjtjjf}tjjdkrd |tjjg}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 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. ZCPythonZPyPyz%s.%s.%sfinalZJythonZ IronPythonUnknown)nameversion) platformZpython_implementationZpython_versionsysZpypy_version_infomajorminormicro releaseleveljoin)implementationZimplementation_versionr//usr/lib/python3/dist-packages/requests/help.py_implementations$     rc Cszttd}Wnty2ddd}Yn0t}dtji}dtji}ddd}trptjdtj j d}dt t ddi}dt t ddi}tj }d|durd|ndi}|||tdu|||||dtid S) z&Generate information for a bug report.)systemreleaserr Nr)r Zopenssl_versionz%xr) r r system_sslZusing_pyopensslZ pyOpenSSLurllib3chardet cryptographyidnaZrequests)r rrIOErrorrrrrOpenSSLZSSLZOPENSSL_VERSION_NUMBERgetattrrrsslrrequests_version) Z platform_infoZimplementation_infoZ urllib3_infoZ chardet_infoZpyopenssl_infoZcryptography_infoZ idna_inforZsystem_ssl_inforrrinfo;sJ        r"cCsttjtddddS)z)Pretty-print the bug information as JSON.T)Z sort_keysindentN)printjsondumpsr"rrrrmainqsr(__main__)__doc__Z __future__rr&r r r rrrrrr!Zurllib3.contribr ImportErrorrrrr"r(__name__rrrrs,    !6