
    MhC                         d Z ddlZddlZddlmZ ddZddZddZd Z	dd
Z
ddZ ej                    dk    ZddZexZZdS )zCompatibility tricks for Python 3. Mainly to do with unicode.

This file is deprecated and will be removed in a future version.
    N   )DEFAULT_ENCODINGc                 @    |pt           }|                     |d          S Nreplace)r   decodesencodings     W/var/www/html/test/jupyter/venv/lib/python3.11/site-packages/IPython/utils/py3compat.pyr   r      !    ++H88Hi(((    c                 @    |pt           }|                     |d          S r   )r   encode)ur   s     r   r   r      r   r   c                 P    t          | t                    rt          | |          S | S N)
isinstancebytesr   r	   s     r   cast_unicoder      s)    !U #a"""Hr   c                     	 t          |           S # t          $ r Y nw xY w	 t          |           S # t          $ r Y nw xY wdS )zlunicode(e) with various fallbacks. Used for exceptions, which may not be
    safe to call unicode() on.
    zUnrecoverably corrupt evalue)strUnicodeErrorrepr)es    r   safe_unicoder      sj    1vv   Aww    *)s    
1 
>> c                 *    t          j        |           S r   )builtin_modinput)prompts    r   r    r    0   s    V$$$r   c                     ||n|}t          | d          5 }|pt          }t           ||                                | d          ||           d d d            d S # 1 swxY w Y   d S )Nrbexec)opencompiler$   read)fnameglobloccompilerfs        r   execfiler-   4   s    /##C	eT		 ;a&wXXaffhhv..c:::; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ;s   8AA #A PyPyc                     | S r    )xr   s     r   no_coder2   A   s    Hr   r   )r   )NN)__doc__platformbuiltinsr   r   r   r   r   r   r   r    r-   python_implementationPYPYr2   unicode_to_strcast_bytes_py2r0   r   r   <module>r:      s    
      & & & & & &) ) ) )
) ) ) )
   * * *&% % % %; ; ; ; &x%''61    #* )r   