ó
ÐH/\c           @` 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 j d ƒ Z e j j d ƒ Z e j d	 k Z e p´ e j d
 ƒ Z e	 rê e 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 „  Z e	 rMd d „ Z! d „  Z" n d d l# m! Z! e! Z! e j" Z" y d d l$ Z% Wn e& k
 r›d d l% Z% n Xe% j' Z( e% j) Z* e	 rÕe+ j, Z- e+ j. Z/ e0 Z1 e2 Z3 n1 e+ j- Z- e+ j/ Z/ e j1 Z1 d d l4 m3 Z3 e3 Z3 d „  Z5 y d d l m6 Z6 Wn  e& k
 rEe5 Z6 d e6 _7 n Xy d d l m8 Z8 WnV e& k
 r²e j9 ƒ  p…e s‚d n d Z: e r e: d k r d n d Z; d „  Z8 n Xy d d l< m= Z= e= Z= WnA e& k
 rd d l< Z< e j d k re< j> Z= qe< j< Z= n Xd S(   sB   
internal gevent python 2/python 3 bridges. Not for external use.
i    (   t   print_functiont   absolute_importt   divisionNi   i   t   pypy_version_infot   wint   linuxt   darwint   PURE_PYTHONt   _threadt   threadc          C` s,   d d  l  }  t t k r" |  j ƒ  S|  j ƒ  S(   Ni    (   t   iot   strt   bytest   BytesIOt   StringIO(   R
   (    (    s-   lib/python2.7/site-packages/gevent/_compat.pyt   NativeStrIO'   s    c         C` s7   | j  | k	 r- | d  k	 r- | j | ƒ ‚ n  | ‚ d  S(   N(   t   __traceback__t   Nonet   with_traceback(   t   tt   valuet   tb(    (    s-   lib/python2.7/site-packages/gevent/_compat.pyt   reraise-   s    c           C` s   d  S(   N(    (    (    (    s-   lib/python2.7/site-packages/gevent/_compat.pyt	   exc_clear1   s    (   R   (   t   izipc         C` sš   t  |  t ƒ r |  St |  ƒ } y | j } Wn$ t k
 rR t d | j ƒ ‚ n X| |  ƒ } t  | t ƒ rr | St d j | j t | ƒ j ƒ ƒ ‚ d S(   sf  
    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.
    s/   expected str, bytes or os.PathLike object, not s7   expected {}.__fspath__() to return str or bytes, not {}N(   t
   isinstancet   native_path_typest   typet
   __fspath__t   AttributeErrort	   TypeErrort   __name__t   format(   t   patht	   path_typet   path_type_fspatht	   path_repr(    (    s-   lib/python2.7/site-packages/gevent/_compat.pyt   _fspathV   s    		(   t   fspathR&   (   t   fsencodes   utf-8t   mbcst   strictt   surrogateescapec         C` sW   t  |  ƒ }  t |  t ƒ r |  Sy |  j t t ƒ SWn t k
 rR t d ƒ ‚ n Xd S(   s  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).
        s(   Can't encode path to filesystem encodingN(   R&   R   R   t   encodet   encodingt   errorst   LookupErrort   UnicodeEncodeError(   t   filename(    (    s-   lib/python2.7/site-packages/gevent/_compat.pyR'   ‚   s    (   t   perf_countert   win32(?   t   __doc__t
   __future__R    R   R   t   syst   ost   version_infot   PY2t   PY3t   hasattrt   PYPYt   platformt
   startswitht   WINt   LINUXt   OSXt   getenvR   R   t   string_typest   intt   integer_typest	   text_typeR   R   t   thread_mod_namet   __builtin__t
   basestringt   unicodet   longR   R   R   R   t   gevent._util_py2t   _impt   impt   ImportErrort   acquire_lockt   imp_acquire_lockt   release_lockt   imp_release_lockt   dictt   itemst	   iteritemst   valuest
   itervaluest   ranget   xranget   zipR   t	   itertoolsR%   R&   R   R'   t   getfilesystemencodingR,   R-   t   timeR1   t   clock(    (    (    s-   lib/python2.7/site-packages/gevent/_compat.pyt   <module>   s‚   															
