HEX
Server: Apache
System: Linux server2.voipitup.com.au 4.18.0-553.104.1.lve.el8.x86_64 #1 SMP Tue Feb 10 20:07:30 UTC 2026 x86_64
User: posscale (1027)
PHP: 8.2.29
Disabled: exec,passthru,shell_exec,system
Upload Files
File: //opt/saltstack/salt/lib/python3.10/site-packages/cheroot/__pycache__/_compat.cpython-310.pyc
o

�N�gT�@s�dZddlmZmZmZeZddlZddlZddl	Z	ddl
Z
zddlZWn
ey1ddl
ZYnwzddlZejdkZ[WneyIdZYnwzddlmZWneygddlmZedd��ZYnwee�d	��Zee�d
��Ze��dkZe��ZedkZed
kZedkZe��Z e �!d�Z"e
j#s�ddd�Z$ddd�Z%ddd�Z&nddd�Z$ddd�Z%ddd�Z&dd�Z'e
j#s�	e(Z(n	e)Z(dd�Z*dS)zECompatibility code for using Cheroot with various versions of Python.�)�absolute_import�division�print_functionN)�r)�suppress)�contextmanagercgs$�zdVWdS|yYdSw)z:Return a context manager that suppresses the `exceptions`.N�)�
exceptionsrr�C/opt/saltstack/salt/lib/python3.10/site-packages/cheroot/_compat.pyrs��rZCIZGITHUB_WORKFLOW�PyPy�Windows�Linux�Darwin�ppc�
ISO-8859-1cCst|�|�|�S�z8Return the native string as bytes in the given encoding.)�
assert_native�encode��n�encodingrrr
�ntob9s
rcC�t|�|S)�<Return the native string as Unicode with the given encoding.�rrrrr
�ntou?srcCs
|�|�S�z>Return the byte string as native string in the given encoding.)�decode��brrrr
�btonEs
r cCrrrrrrr
rJscCs2t|�|dkrt�ddd�|�d��S|�|�S)r�escapez\\u([0-9a-zA-Z]{4})cSst�t|�d�d��S)Nr�)�sixZunichr�int�group)�mrrr
�<lambda>]szntou.<locals>.<lambda>r)r�re�subrrrrr
rRs�
cCs|Srrrrrr
r dscCs t|t�stdt|�j��dS)zxCheck whether the input is of native :py:class:`str` type.

    Raises:
        TypeError: in case of failed check

    zn must be a native str (got %s)N)�
isinstance�str�	TypeError�type�__name__)rrrr
ris
�rcCs6t|t�rtjrt|�S|��St|t�r|Std��)aRRetrieve bytes out of the given input buffer.

    :param mv: input :py:func:`buffer`
    :type mv: memoryview or bytes

    :return: unwrapped bytes
    :rtype: bytes

    :raises ValueError: if the input is not one of \
                        :py:class:`memoryview`/:py:func:`buffer` \
                        or :py:class:`bytes`
    z8extract_bytes() only accepts bytes and memoryview/buffer)r*�
memoryviewr#�PY2�bytes�tobytes�
ValueError)�mvrrr
�
extract_bytess


�r5)r)+�__doc__Z
__future__rrrr-Z
__metaclass__�os�platformr(r#�	selectors�ImportErrorZ
selectors2�ssl�OPENSSL_VERSION_INFOZIS_ABOVE_OPENSSL10�
contextlibrr�bool�getenvZIS_CIZIS_GITHUB_ACTIONS_WORKFLOW�python_implementationZIS_PYPY�systemZSYS_PLATFORMZ
IS_WINDOWSZIS_LINUXZIS_MACOS�machineZ
PLATFORM_ARCH�
startswithZIS_PPCr0rrr rr/�bufferr5rrrr
�<module>sb�
��