a
    lcA                     @   s|   d Z ddlZddlZddlmZ dddZdddZdd	d
Zdd Z	dddZ
dddZe dkZdddZe 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                 C   s   |pt }| |dS Nreplace)r   decodesencoding r
   S/var/www/html/django/DPS/env/lib/python3.9/site-packages/IPython/utils/py3compat.pyr      s    r   c                 C   s   |pt }| |dS r   )r   encode)ur	   r
   r
   r   r      s    r   c                 C   s   t | trt| |S | S N)
isinstancebytesr   r   r
   r
   r   cast_unicode   s    

r   c                 C   s@   z
t | W S  ty   Y n0 z
t| W S  ty:   Y n0 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)er
   r
   r   safe_unicode   s    

r    c                 C   s
   t | S r   )builtin_modinput)promptr
   r
   r   r   /   s    r   c                 C   s^   |d ur|n|}t | d0}|p"t}t|| | d|| W d    n1 sP0    Y  d S )Nrbexec)opencompiler   read)fnameglobloccompilerfr
   r
   r   execfile3   s    r%   PyPyc                 C   s   | S r   r
   )xr	   r
   r
   r   no_code?   s    r(   )N)N)N)r   )NN)N)__doc__platformbuiltinsr   r	   r   r   r   r   r   r   r%   python_implementationPYPYr(   Zunicode_to_strZcast_bytes_py2r
   r
   r
   r   <module>   s   





