3
W>p_·  ã               @   sŒ   d Z ddlmZ ddlmZmZmZmZ yddlmZ W n e	k
rV   ddd„ZY nX ydd	lm
Z
 W n e	k
r†   dd
d„Z
Y nX dS )z™Backward compatibility layer with older version of six.

This is used to avoid virtualenv requring a version of six newer than what
the system may have.
é    )Úabsolute_import)ÚPY2ÚPY3Úbinary_typeÚ	text_type)Úensure_textúutf-8Ústrictc             C   s8   t | tƒr| j||ƒS t | tƒr$| S tdt| ƒ ƒ‚dS )zÎCoerce *s* to six.text_type.
        For Python 2:
        - `unicode` -> `unicode`
        - `str` -> `unicode`
        For Python 3:
        - `str` -> `str`
        - `bytes` -> decoded to `str`
        znot expecting type '%s'N)Ú
isinstancer   Údecoder   Ú	TypeErrorÚtype)ÚsÚencodingÚerrors© r   úˆ/home/aldo/Documentos/tesis/tesis/device auto/pruebas pulsar/pruebaclonado/envClonado/lib/python3.6/site-packages/virtualenv/util/six.pyr      s
    	

r   )Ú
ensure_strc             C   sX   t | ttfƒstdt| ƒ ƒ‚tr:t | tƒr:| j||ƒ} ntrTt | tƒrT| j||ƒ} | S )zÉCoerce *s* to `str`.
        For Python 2:
        - `unicode` -> encoded to `str`
        - `str` -> `str`
        For Python 3:
        - `str` -> `str`
        - `bytes` -> decoded to `str`
        znot expecting type '%s')	r
   r   r   r   r   r   Úencoder   r   )r   r   r   r   r   r   r   #   s    	r   N)r   r	   )r   r	   )Ú__doc__Ú
__future__r   Úsixr   r   r   r   r   ÚImportErrorr   r   r   r   r   Ú<module>   s   