o
    8j                     @   s   d Z ddlZddlZddlZddlZddlmZ ddlmZ ddlm	Z
 dZdZzddlmZ W n ey?   dZdZdZY n	w ddlZddlZdd	 Zd
d Zdd Zedkr]e  dS dS )z'Module containing bug report helper(s).    N)idna)urllib3   )__version__)	pyopensslc                  C   s   t  } | dkrt  }n8| dkr1tj}|j d|j d|j }tjjdkr0d	|tjjg}n| dkr:t  }n| dkrCt  }nd}| |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 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.
    CPythonPyPy.final Jython
IronPythonUnknown)nameversion)
platformpython_implementationpython_versionsyspypy_version_infomajorminormicroreleaseleveljoin)implementationimplementation_versionpypy r   t/opt/pipey-apps/247c6e86-d9cc-49a2-98d3-9f311455f2db/.venv/lib/python3.10/site-packages/pip/_vendor/requests/help.py_implementation   s"   




r    c            
      C   s   zt  t  d} W n ty   ddd} Y nw t }dtji}ddi}ddi}tr1dtji}tr8dtji}ddd}t	rIt	jt	j
jdd}dttddi}dttddi}tj}d|dure|dndi}	| ||	tdutdu ||||||dtid	S )
z&Generate information for a bug report.)systemreleaser   r   Nr   )r   openssl_versionxr   )r   r   
system_sslusing_pyopensslusing_charset_normalizer	pyOpenSSLr   chardetcharset_normalizercryptographyr   requests)r   r!   r"   OSErrorr    r   r   r*   r)   OpenSSLSSLOPENSSL_VERSION_NUMBERgetattrr+   r   sslr   requests_version)
platform_infoimplementation_infourllib3_infocharset_normalizer_infochardet_infopyopenssl_infocryptography_info	idna_infor%   system_ssl_infor   r   r   info;   sX   





r=   c                   C   s   t tjt ddd dS )z)Pretty-print the bug information as JSON.T   )	sort_keysindentN)printjsondumpsr=   r   r   r   r   mainv   s   rD   __main__)__doc__rB   r   r2   r   pip._vendorr   r   r   r   r3   r*   r)   pip._vendor.urllib3.contribr   ImportErrorr.   r+   r    r=   rD   __name__r   r   r   r   <module>   s2     ;
