3
Re
@ s d Z ddlmZ ddlZddlZddlZddlZddlmZ ddlm Z ddlm
Z
ddlmZ
ydd lmZ W n ek
r dZdZdZY nX ddlZddlZd
d Zdd
Zdd Zedkre dS )z'Module containing bug report helper(s). )print_functionN)idna)urllib3)chardet )__version__) pyopensslc C s t j } | dkrt j }nj| dkr\dtjjtjjtjjf }tjjdkrdj |tjjg}n(| dkrnt j }n| dkrt j }nd}| |d S )
a Return 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.%sfinal Jython
IronPythonUnknown)nameversion)
platformpython_implementationpython_versionsyspypy_version_infomajorminormicroreleaseleveljoin)implementationimplementation_version r /builddir/build/BUILDROOT/alt-python36-pip-20.2.4-5.el9.x86_64/opt/alt/python36/lib/python3.6/site-packages/pip/_vendor/requests/help.py_implementation s
r c C s yt j t j d} W n tk
r4 ddd} Y nX t }dtji}dtji}ddd}trrtjdtj j
d}dttddi}dtt
ddi}tj
}d|dk rd| ndi}| ||tdk |||||dtid
S )
z&Generate information for a bug report.)systemreleaser r Nr )r openssl_versionz%xr )
r r
system_sslZusing_pyopensslZ pyOpenSSLr r cryptographyr requests)r r! r" IOErrorr r r r OpenSSLZSSLOPENSSL_VERSION_NUMBERgetattrr% r sslr requests_version) Z
platform_infoZimplementation_infoZurllib3_infoZchardet_infoZpyopenssl_infoZcryptography_infoZ idna_infor$ Zsystem_ssl_infor r r info; s8
r- c C s t tjt ddd dS )z)Pretty-print the bug information as JSON.T ) sort_keysindentN)printjsondumpsr- r r r r mainq s r4 __main__)__doc__
__future__r r2 r r r+ pip._vendorr r r r r r, pip._vendor.urllib3.contribr ImportErrorr( r% r r- r4 __name__r r r r