a
    ‘db2  ã                   @   s  d Z ddlmZ ddlZddlmZ z
ejZW n eyF   ej	ZY n0 dZ
dZdZee
krbdZneekrpd	ZndZzeZW n ey’   eZY n0 eeu r¦d
d„ Zndd„ ZzeefZW n eyÒ   efZY n0 eZedƒZedƒZdd„ Zdd„ Zdd„ Zdefdd„ZdS )zPython compatibility wrappers.é    )Úabsolute_importN©Úpackl   ÿÿÿÿ iÿÿÿiÿ  é@   é    c                 C   s
   |   d¡S )NÚlatin1)Úencode©Ús© r   ú\/home/tom/ab/renpy-build/tmp/install.linux-x86_64/lib/python3.9/site-packages/rsa/_compat.pyÚbyte_literal5   s    r   c                 C   s   | S )Nr   r	   r   r   r   r   8   s    ú Ú c                 C   s
   t | tƒS )z½
    Determines whether the given value is a byte string.

    :param obj:
        The value to test.
    :returns:
        ``True`` if ``value`` is a byte string; ``False`` otherwise.
    )Ú
isinstanceÚbytes©Úobjr   r   r   Úis_bytesH   s    	r   c                 C   s
   t | tƒS )z·
    Determines whether the given value is an integer.

    :param obj:
        The value to test.
    :returns:
        ``True`` if ``value`` is an integer; ``False`` otherwise.
    )r   Úinteger_typesr   r   r   r   Ú
is_integerT   s    	r   c                 C   s
   t d| ƒS )ad  
    Converts a number between 0 and 255 (both inclusive) to a base-256 (byte)
    representation.

    Use it as a replacement for ``chr`` where you are expecting a byte
    because this will work on all current versions of Python::

    :param num:
        An unsigned integer between 0 and 255 (both inclusive).
    :returns:
        A single byte.
    ÚBr   )Únumr   r   r   Úbyte`   s    r   c                 C   sl   d}d}d}d}|dkr4|dkr4| |kr4dd|dfS | |krHdd	|d
fS | |kr\dd|dfS dd|dfS dS )aD  
    Returns alignment details for the given number based on the platform
    Python is running on.

    :param num:
        Unsigned integral number.
    :param force_arch:
        If you don't want to use 64-bit unsigned chunks, set this to
        anything other than 64. 32-bit chunks will be preferred then.
        Default 64 will be used when on a 64-bit machine.
    :param _machine_word_size:
        (Internal) The machine word size used for alignment.
    :returns:
        4-tuple::

            (word_bits, word_bytes,
             max_uint, packing_format_type)
    l   ÿÿÿÿ l   ÿÿ iÿÿ  éÿ   r   é   ÚQr   é   ÚLé   é   ÚHé   r   Nr   )r   Z
force_archZ_machine_word_sizeZ
max_uint64Z
max_uint32Z
max_uint16Z	max_uint8r   r   r   Úget_word_alignmentp   s    r#   )Ú__doc__Ú
__future__r   ÚsysÚstructr   ÚmaxsizeZMAX_INTÚAttributeErrorZmaxintZ	MAX_INT64Z	MAX_INT32Z	MAX_INT16ZMACHINE_WORD_SIZEÚunicodeZunicode_typeÚ	NameErrorÚstrr   ÚintÚlongr   ÚbZ	ZERO_BYTEZ
EMPTY_BYTEr   r   r   r#   r   r   r   r   Ú<module>   sF   


ÿ