ó
Ð²Ebc           @   sI   d  d l  m Z m Z d  d l m Z d  d l m Z m Z d „  Z d S(   i   (   t   PY2t   PY3(   t   UniversalDetector(   t   __version__t   VERSIONc         C   sk   t  |  t ƒ sK t  |  t ƒ s< t d j t |  ƒ ƒ ƒ ‚ qK t |  ƒ }  n  t ƒ  } | j |  ƒ | j ƒ  S(   s£   
    Detect the encoding of the given byte string.

    :param byte_str:     The byte sequence to examine.
    :type byte_str:      ``bytes`` or ``bytearray``
    s4   Expected object of type bytes or bytearray, got: {0}(	   t
   isinstancet	   bytearrayt   bytest	   TypeErrort   formatt   typeR   t   feedt   close(   t   byte_strt   detector(    (    s9   /tmp/pip-build-UPPWic/pip/pip/_vendor/chardet/__init__.pyt   detect   s    		N(	   t   compatR    R   t   universaldetectorR   t   versionR   R   R   (    (    (    s9   /tmp/pip-build-UPPWic/pip/pip/_vendor/chardet/__init__.pyt   <module>   s   