
    g#                        d Z ddlZddlZ	 ddlZej                  dk\  Z[ 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j+                  d      ZddZddZddZd Zd Zy# e$ r dZY w xY w)zECompatibility code for using Cheroot with various versions of Python.    N)   r   CIGITHUB_WORKFLOWPyPyWindowsLinuxDarwinSunOSppcc                 :    t        |        | j                  |      S )z8Return the native string as bytes in the given encoding.)assert_nativeencodenencodings     $/opt/Tautulli/lib/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                 $    | j                  |      S )z>Return the byte string as native string in the given encoding.)decode)br   s     r   btonr   /   s    88Hr   c                 f    t        | t              s!t        dt        |       j                  z        y)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   4   s.     a9DG<L<LLMM r   c                 |    t        | t              r| j                         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'   ?   s9     "j!zz|"e	
B r   )z
ISO-8859-1)__doc__osplatformsslOPENSSL_VERSION_INFO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>r@      s    K 	 11V;
 	YRYYt_!)")),=">?  )(
(
(
*f
4 x Y&
7"8#W$
   "		!	!%	(
Ng  s   B> >CC