403Webshell
Server IP : 66.29.132.122  /  Your IP : 18.223.172.180
Web Server : LiteSpeed
System : Linux business142.web-hosting.com 4.18.0-553.lve.el8.x86_64 #1 SMP Mon May 27 15:27:34 UTC 2024 x86_64
User : admazpex ( 531)
PHP Version : 7.2.34
Disable Function : NONE
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : ON  |  Sudo : OFF  |  Pkexec : OFF
Directory :  /proc/self/root/proc/self/root/proc/thread-self/root/proc/thread-self/root/opt/alt/python37/lib/python3.7/site-packages/virtualenv/util/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /proc/self/root/proc/self/root/proc/thread-self/root/proc/thread-self/root/opt/alt/python37/lib/python3.7/site-packages/virtualenv/util/six.py
"""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.
"""
from __future__ import absolute_import

from six import PY2, PY3, binary_type, text_type

try:
    from six import ensure_text
except ImportError:

    def ensure_text(s, encoding="utf-8", errors="strict"):
        """Coerce *s* to six.text_type.
        For Python 2:
        - `unicode` -> `unicode`
        - `str` -> `unicode`
        For Python 3:
        - `str` -> `str`
        - `bytes` -> decoded to `str`
        """
        if isinstance(s, binary_type):
            return s.decode(encoding, errors)
        elif isinstance(s, text_type):
            return s
        else:
            raise TypeError("not expecting type '%s'" % type(s))


try:
    from six import ensure_str
except ImportError:

    def ensure_str(s, encoding="utf-8", errors="strict"):
        """Coerce *s* to `str`.
        For Python 2:
        - `unicode` -> encoded to `str`
        - `str` -> `str`
        For Python 3:
        - `str` -> `str`
        - `bytes` -> decoded to `str`
        """
        if not isinstance(s, (text_type, binary_type)):
            raise TypeError("not expecting type '%s'" % type(s))
        if PY2 and isinstance(s, text_type):
            s = s.encode(encoding, errors)
        elif PY3 and isinstance(s, binary_type):
            s = s.decode(encoding, errors)
        return s

Youez - 2016 - github.com/yon3zu
LinuXploit