
    ;;iU                     z    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y)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                 :    |xs t         }| j                  |d      S Nreplace)r   decodesencodings     T/home/rose/Desktop/poly/venv/lib/python3.12/site-packages/IPython/utils/py3compat.pyr   r          ++H88Hi((    c                 :    |xs t         }| j                  |d      S r   )r   encode)ur   s     r   r   r      r   r   c                 >    t        | t              rt        | |      S | S N)
isinstancebytesr   r	   s     r   cast_unicoder      s    !Ua""Hr   c                 n    	 t        |       S # t        $ r Y nw xY w	 t        |       S # t        $ r Y yw xY w)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      sE    1v Aw )s   
 	
( 	44c                 ,    t        j                  |       S r   )builtin_modinput)prompts    r   r   r   0   s    V$$r   c                     ||n|}t        | d      5 }|xs t        }t         ||j                         | d      ||       d d d        y # 1 sw Y   y xY w)Nrbexec)opencompiler#   read)fnameglobloccompilerfs        r   execfiler,   4   sJ    /#C	eT	a&wXaffhv.c: 
		s   .A

APyPyr   ) )NN)__doc__platformbuiltinsr   r   r   r   r   r   r   r   r,   python_implementationPYPY r   r   <module>r5      sJ   
   &)
)
*&%; &x%%'61r   