
    3j=
                     Z   S r SSKrSr\R                  SS S:  a  \rO\r \r\R                  SS S:  a  \
r
SrSS jr\	\4rSS	 jrOS
r\" SS5      rSS jr\r
\	4rSS jr\(       + r\" \S5      (       a  \R"                  rO\R$                  rSS jrg! \ a  r\	r SrCNSrCff = f)a  8-bit string definitions for Python 2/3 compatibility

Defines the following which allow for dealing with Python 3 breakages:

    STR_IS_BYTES
    STR_IS_UNICODE
    
        Easily checked booleans for type identities
    
    _NULL_8_BYTE
    
        An 8-bit byte with NULL (0) value 
    
    as_8_bit( x, encoding='utf-8')
    
        Returns the value as the 8-bit version
    
    unicode -- always pointing to the unicode type 
    bytes -- always pointing to the 8-bit bytes type
    NT   )r      )   r    c                 d    [        U [        5      (       a  U R                  U5      $ [        U 5      $ N)
isinstanceunicodeencodebytesxencodings     G/home/wildlama/miniconda3/lib/python3.13/site-packages/OpenGL/_bytes.pyas_8_bitr   &   s(    q'##88X''az    c                     [        U [        5      (       a  U $ [        U [        5      (       a  U R                  U5      $ [	        U 5      $ z:Produce a native string (i.e. different on python 2 and 3))r	   r   r
   r   strr   s     r   as_strr   +   s9    aH'""88H%%q6Mr   Flatin1c                     [        U [        5      (       a  U R                  U5      $ [        U [        5      (       a  U $ [	        U 5      R                  U5      $ r   )r	   r
   r   r   r   r   s     r   r   r   7   sE    q""88H%%E## H1v}}h((r   c                     [        U [        5      (       a  U $ [        U [        5      (       a  U R                  U5      $ [	        U 5      $ r   )r	   r
   r   decoder   r   s     r   r   r   B   s9    a  H%  88H%%q6Mr   maxsizec                     [        U [        5      (       a  U $ [        U [        5      (       a   U R                  U5      $ [        U 5      $ ! [         a  nU R                  S5      s SnA$ SnAff = f)z1Ensure is a unicode object given default encodingzlatin-1N)r	   r
   r   r   UnicodeDecodeError)r   r   errs      r   
as_unicoder   Q   sb    !G	Ae			'88H%% qz " 	'88I&&	's   A
 

A/A*$A/*A/)zutf-8)__doc__sysSTR_IS_BYTESversion_infor   r   long	NameErrorr   intr
   _NULL_8_BYTEr   integer_typesr   STR_IS_UNICODEhasattrr   maxintr    r   r   <module>r-      s   ( BQ%EED BQ%GL HM L&+L) GDM "!
CkkGjjG
c  Ds   B B*B%%B*