
    5i}                        d Z ddlZddlZ	 ddlZej        dk    Zej        dk    Z[n# e$ r dZdZY nw xY w e ej	        d                    Z
 e ej	        d                    Z ej                    dk    Z ej                    Zedk    Zed	k    Zed
k    Zedk    Z ej                    Ze                    d          ZddZddZddZd Zd ZdS )zECompatibility code for using Cheroot with various versions of Python.    N)      )r   r   CIGITHUB_WORKFLOWPyPyWindowsLinuxDarwinSunOSppc
ISO-8859-1c                 J    t          |            |                     |          S )z8Return the native string as bytes in the given encoding.)assert_nativeencodenencodings     E/home/kali/Ninja/venv/lib/python3.11/site-packages/cheroot/_compat.pyntobr   $   s"    !88H    c                 $    t          |            | S )z<Return the native string as Unicode with the given encoding.)r   r   s     r   ntour   +   s    !Hr   c                 ,    |                      |          S )z>Return the byte string as native string in the given encoding.)decode)br   s     r   btonr   2   s    88Hr   c                 x    t          | t                    s$t          dt          |           j        z            dS )zxCheck whether the input is of native :py:class:`str` type.

    Raises:
        TypeError: in case of failed check

    zn must be a native str (got %s)N)
isinstancestr	TypeErrortype__name__)r   s    r   r   r   7   s@     a N9DGG<LLMMMN Nr   c                     t          | t                    r|                                 S t          | t                    r| S t	          d          )aR  Retrieve 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   
memoryviewtobytesbytes
ValueError)mvs    r   extract_bytesr)   B   sP     "j!! zz||"e 	
B  r   )r   )__doc__osplatformsslOPENSSL_VERSION_INFOIS_ABOVE_OPENSSL31IS_ABOVE_OPENSSL10ImportErrorboolgetenvIS_CIIS_GITHUB_ACTIONS_WORKFLOWpython_implementationIS_PYPYsystemSYS_PLATFORM
IS_WINDOWSIS_LINUXIS_MACOS
IS_SOLARISmachinePLATFORM_ARCH
startswithIS_PPCr   r   r   r   r)    r   r   <module>rC      s   K K 				 JJJ1F:1V;   
 	YRYt__!T)"),=">">??  )(
(
*
*f
4 x  Y&
7"8#W$
  ""		!	!%	(	(         
N N N    s   ( 	44