B
öÎ7žÛZ%ã @ sŒ d Z ddlmZ ddlmZmZmZmZ yddlmZ W n e k
rV d
dd„ZY nX ydd lm
Z
W n e k
r† dd
d„Z
Y nX dS )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| ||¡S t | tƒr$| S tdt| ƒ ƒ‚dS )zÎCoerce *s* to six.text_type.
For Python 2:
- `unicode` -> `unicode`
- `str` -> `unicode`
For Python 3:
- `str` -> `str`
- `bytes` -> decoded to `str`
znot expecting type '%s'N)Ú
isinstancer Údecoder Ú TypeErrorÚtype)ÚsÚencodingÚerrors© r úD/opt/alt/python37/lib/python3.7/site-packages/virtualenv/util/six.pyr s
r )Ú
ensure_strc C sX t | ttfƒstdt| ƒ ƒ‚tr:t | tƒr:| ||¡} ntrTt | tƒrT| ||¡} | S )zÉCoerce *s* to `str`.
For Python 2:
- `unicode` -> encoded to `str`
- `str` -> `str`
For Python 3:
- `str` -> `str`
- `bytes` -> decoded to `str`
znot 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 Zsixr r r r r ÚImportErrorr r r r r Ú