B
    H/\                 @   s`  d Z ddlmZmZmZ ddlZddlZejd dkZejd dkZ	e
edZejdZejdZejd	kZep|ed
Ze	refZefZeZeefZdZn(ddlZejfZejZeejfZeZdZdd Ze	rd"ddZ dd Z!nddl"m Z  e Z ej!Z!yddl#Z$W n e%k
r(   ddl$Z$Y nX e$j&Z'e$j(Z)e	rRe*j+Z,e*j-Z.e/Z0e1Z2n"e*j,Z,e*j.Z.ej0Z0ddl3m2Z2 e2Z2dd Z4yddlm5Z5 W n  e%k
r   e4Z5de5_6Y nX yddlm7Z7 W nN e%k
r   e8 pesdndZ9ere9dkrdndZ:dd Z7Y nX ydd l;m<Z< e<Z<W n8 e%k
rZ   ddl;Z;ejd!krPe;j=Z<ne;j;Z<Y nX dS )#zB
internal gevent python 2/python 3 bridges. Not for external use.
    )print_functionabsolute_importdivisionN      Zpypy_version_infowinZlinuxdarwinPURE_PYTHON_threadZthreadc              C   s    dd l } ttkr|  S |  S )Nr   )iostrbytesBytesIOStringIO)r    r   -lib/python3.7/site-packages/gevent/_compat.pyNativeStrIO'   s    r   c             C   s$   |j |k	r|d k	r|||d S )N)__traceback__with_traceback)tvaluetbr   r   r   reraise-   s    
r   c               C   s   d S )Nr   r   r   r   r   	exc_clear1   s    r   )r   )izipc             C   sv   t | tr| S t| }y
|j}W n" tk
rB   td|j Y nX || }t |trZ|S td|jt|jdS )af  
    Return the path representation of a path-like object.

    If str or bytes is passed in, it is returned unchanged. Otherwise the
    os.PathLike interface is used to get the path representation. If the
    path representation is not str or bytes, TypeError is raised. If the
    provided path is not str, bytes, or os.PathLike, TypeError is raised.
    z/expected str, bytes or os.PathLike object, not z7expected {}.__fspath__() to return str or bytes, not {}N)
isinstancenative_path_typestype
__fspath__AttributeError	TypeError__name__format)path	path_typeZpath_type_fspath	path_reprr   r   r   _fspathV   s    	


r&   )fspathr'   )fsencodezutf-8mbcsstrictsurrogateescapec             C   sD   t | } t| tr| S y| ttS  tk
r>   tdY nX dS )a  Encode filename (an os.PathLike, bytes, or str) to the filesystem
        encoding with 'surrogateescape' error handler, return bytes unchanged.
        On Windows, use 'strict' error handler if the file system encoding is
        'mbcs' (which is the default encoding).
        z(Can't encode path to filesystem encodingN)r'   r   r   encodeencodingerrorsLookupErrorUnicodeEncodeError)filenamer   r   r   r(      s    
r(   )perf_counterZwin32)N)>__doc__Z
__future__r   r   r   sysosversion_infoZPY2ZPY3hasattrZPYPYplatform
startswithZWINZLINUXZOSXgetenvr	   r   Zstring_typesintZinteger_typesZ	text_typer   r   Zthread_mod_nameZ__builtin__Z
basestringZunicodeZlongr   r   r   Zgevent._util_py2_impimpImportErroracquire_lockZimp_acquire_lockrelease_lockZimp_release_lockdictitemsZ	iteritemsvaluesZ
itervaluesrangeZxrangezipr   	itertoolsr&   r'   r!   r(   getfilesystemencodingr-   r.   Ztimer2   Zclockr   r   r   r   <module>   s   




