
0c@_                 @   s  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 m Z d d l m	 Z	 d d l m
 Z
 d d l m Z y d d	 l m Z Wn$ e k
 r d Z d Z d Z Yn Xd 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).    )print_functionN)idna)urllib3)chardet   )__version__)	pyopensslc              C   s   t  j   }  |  d k r' t  j   } n |  d k r d t j j t j j t j j f } t j j d k r d j	 | t j j g  } n< |  d k r t  j   } n! |  d k r t  j   } n d } d	 |  d
 | i 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PyPyz%s.%s.%sfinal Jython
IronPythonUnknownnameversion)
platformpython_implementationpython_versionsyspypy_version_infomajorminormicroreleaseleveljoin)implementationimplementation_version r   8/tmp/pip-build-jynh7p1z/pip/pip/_vendor/requests/help.py_implementation   s     	r    c        	      C   sN  y" d t  j   d t  j   i }  Wn$ t k
 rH d d d d i }  Yn Xt   } d t j i } d t j i } d d d d i } t r d t j d d t j	 j
 i } d t t d	 d  i } d t t d	 d  i } t j
 } d | d k	 r d | n d i } d
 |  d | d | d t d k	 d | d | d | d | d | d d t i i
 S)z&Generate information for a bug report.systemreleaser   r   Nopenssl_versionr   z%xr   r   r   
system_sslZusing_pyopensslZ	pyOpenSSLr   r   cryptographyr   requests)r   r!   r"   IOErrorr    r   r   r   OpenSSLZSSLOPENSSL_VERSION_NUMBERgetattrr%   r   sslr   requests_version)	Zplatform_infoZimplementation_infoZurllib3_infoZchardet_infoZpyopenssl_infoZcryptography_infoZ	idna_infor$   Zsystem_ssl_infor   r   r   info;   s:    			"r-   c               C   s&   t  t j t   d d d d  d S)z)Pretty-print the bug information as JSON.	sort_keysTindent   N)printjsondumpsr-   r   r   r   r   mainq   s    r4   __main__)__doc__
__future__r   r2   r   r   r+   Zpip._vendorr   r   r   r   r   r,   Zpip._vendor.urllib3.contribr   ImportErrorr(   r%   r    r-   r4   __name__r   r   r   r   <module>   s,   !6