
                            d Z ddlm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 	 ddlZ	 ddlZ	 ddlmZ ddlZddlZd Zd Zd	 Zed
k(  r e        yy# e$ r dZY 4w xY w# e$ r dZY <w xY w# e$ r	 dZdZdZY >w xY w)z'Module containing bug report helper(s).    )print_functionN   )__version__)	pyopensslc                     t        j                         } | dk(  rt        j                         }n| dk(  rt        j                  j
                  dt        j                  j                  dt        j                  j                  }t        j                  j                  dk7  rbdj                  |t        j                  j                  g      }n6| dk(  rt        j                         }n| dk(  rt        j                         }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 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.
    CPythonPyPy.final Jython
IronPythonUnknown)nameversion)
platformpython_implementationpython_versionsyspypy_version_infomajorminormicroreleaseleveljoin)implementationimplementation_versions     (platform/bq/third_party/requests/help.py_implementationr   $   s     335N"!)!8!8!:	6	!/2/D/D/J/J/2/D/D/J/J/2/D/D/J/J"L   --8%'WW&(=(=(J(J. &" 
8	#!)!8!8!:	<	'!)!8!8!:!*"/EFF    c                  \   	 t        j                         t        j                         d} t	               }dt
        j                  i}ddi}ddi}t        rdt        j                  i}t        rdt        j                  i}ddd}t        r.t        j                  dt        j                  j                  z  d}dt        t        dd      i}dt        t        dd      i}t        j                  }d|d|z  ndi}	| ||	t         dut        du ||||||dt"        id	S # t        $ r ddd} Y w xY w)
z&Generate information for a bug report.)systemreleaser   r   Nr   )r   openssl_versionz%xr   )r   r   
system_sslusing_pyopensslusing_charset_normalizer	pyOpenSSLurllib3chardetcharset_normalizercryptographyidnarequests)r   r"   r#   IOErrorr   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_infos
             r   infor?   E   sf   	
oo''')
 *+w223L($/t$L#,.@.L.L"M!7#6#67 N **#gkk&H&HH

 	7<; 	743I ++J
(>4*$BO
 "-%$D0$+tO#5)'
 I  
 

s   )D D+*D+c                  V    t        t        j                  t               dd             y)z)Pretty-print the bug information as JSON.T   )	sort_keysindentN)printjsondumpsr?    r    r   mainrH      s    	$**TVtA
67r    __main__)__doc__
__future__r   rE   r   r   r4   r-   r)   r   r   r5   r+   ImportErrorr*   urllib3.contribr   r0   r,   r   r?   rH   __name__rG   r    r   <module>rO      s    - %   
 
   -) GB:z8
 zF m  
  G
  IGLs3   A A$ A1 A! A!$A.-A.1A?>A?