← Back
Editing: py3compat.cpython-311.pyc
� �@�cA � � � d Z ddlZddlZddlmZ dd�Zdd�Zdd�Zd� Z dd �Z dd�Z ej � � dk Z dd �ZexZZdS )z�Compatibility tricks for Python 3. Mainly to do with unicode. This file is deprecated and will be removed in a future version. � N� )�DEFAULT_ENCODINGc �@ � |pt }| � |d� � S �N�replace)r �decode��s�encodings �9/usr/lib/python3/dist-packages/IPython/utils/py3compat.pyr r �! � ��+�+�H��8�8�H�i�(�(�(� c �@ � |pt }| � |d� � S r )r �encode)�ur s r r r r r c �P � t | t � � rt | |� � S | S �N)� isinstance�bytesr r s r �cast_unicoder s) � ��!�U��� #��a��"�"�"��Hr c � � t | � � S # t $ r Y nw xY w t | � � S # t $ r Y nw xY wdS )zlunicode(e) with various fallbacks. Used for exceptions, which may not be safe to call unicode() on. zUnrecoverably corrupt evalue)�str�UnicodeError�repr)�es r �safe_unicoder sj � � ��1�v�v� ��� � � ��� ���� ��A�w�w���� � � ��� ���� *�)s � � ��1 � >�>� c �* � t j | � � S r )�builtin_mod�input)�prompts r r r / s � ���V�$�$�$r c �� � |�|n|}t | d� � 5 }|pt }t ||� � � | d� � ||� � d d d � � d S # 1 swxY w Y d S )N�rb�exec)�open�compiler$ �read)�fname�glob�loc�compiler�fs r �execfiler- 3 s� � ��/�#�#��C� �e�T� � � ;�a��&�w���X�X�a�f�f�h�h��v� .� .��c�:�:�:�;� ;� ;� ;� ;� ;� ;� ;� ;� ;� ;� ;���� ;� ;� ;� ;� ;� ;s �8A�A �#A �PyPyc � � | S r � )�xr s r �no_coder2 ? 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
Save File
Cancel