U
    ð~Hj#  ã                   @   sø   d Z ddlZddlZddlZddlZddlZddlZddlmZ	 zddl
Z
W n ek
rd   dZ
Y nX zddlZW n ek
rŠ   dZY nX zddlmZ W n  ek
r¼   dZdZdZY nX ddlZddlZdd„ Zdd	„ Zd
d„ Zedkrôeƒ  dS )z'Module containing bug report helper(s).é    Né   )Ú__version__)Ú	pyopensslc                  C   sŽ   t  ¡ } | dkrt  ¡ }nj| dkr\d tjjtjjtjj¡}tjj	dkr„d 
|tjj	g¡}n(| dkrnt  ¡ }n| dkr€t  ¡ }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ÚPyPyz{}.{}.{}ÚfinalÚ ÚJythonÚ
IronPythonÚUnknown)ÚnameÚversion)ÚplatformÚpython_implementationÚpython_versionÚformatÚsysÚpypy_version_infoÚmajorÚminorÚmicroÚreleaselevelÚjoin)ÚimplementationÚimplementation_version© r   ú1/tmp/pip-unpacked-wheel-nbxurggt/requests/help.pyÚ_implementation"   s&    
ý
ÿ

r   c            
      C   sü   zt  ¡ t  ¡ dœ} W n tk
r4   dddœ} Y nX tƒ }dtji}ddi}ddi}trddtji}trrdtji}dddœ}t	r”t	jt	j
jd›dœ}dttddƒi}dttddƒi}tj}d|dk	rÌ|d›ndi}	| ||	tdk	tdk||||||dtid	œS )
z&Generate information for a bug report.)ÚsystemÚreleaser   r   Nr   )r   Úopenssl_versionÚxr   )r   r   Ú
system_sslZusing_pyopensslZusing_charset_normalizerÚ	pyOpenSSLÚurllib3ÚchardetÚcharset_normalizerÚcryptographyÚidnaÚrequests)r   r   r   ÚOSErrorr   r$   r   r&   r%   ÚOpenSSLÚSSLÚOPENSSL_VERSION_NUMBERÚgetattrr'   r(   Ússlr   Úrequests_version)
Zplatform_infoZimplementation_infoZurllib3_infoZcharset_normalizer_infoZchardet_infoZpyopenssl_infoZcryptography_infoZ	idna_infor"   Zsystem_ssl_infor   r   r   ÚinfoE   s\    þ
þ


þ
þ 
ÿ 
ÿ ÿôr1   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Údumpsr1   r   r   r   r   Úmain€   s    r8   Ú__main__)Ú__doc__r6   r   r/   r   r(   r$   r   r   r0   r&   ÚImportErrorr%   Zurllib3.contribr   r+   r'   r   r1   r8   Ú__name__r   r   r   r   Ú<module>   s8   


#;