a
    /§»af  ã                   @   sh   d dl Z d dlZejjjZdZdd„ ZG dd„ deƒZe jdkrLde_	dZ
nd d	lmZ
 d d	lmZ dS )
é    Nc           	      C   s˜  | pd  d¡}|d g}|dd… D ]B}| d¡sF| d¡sF| d¡rR| |¡ q$|d	  d
| 7  < q$|dd… }dg}dg}|dd… D ]î}| d¡�r|d	 rªd}nd}| t|ƒ¡ |d	  d7  < | d¡ | ddt|ƒd   | |dd…  ¡ qŒ| d¡�rL| d¡�sJ ‚| ¡  | ¡  ||d	   |dd… 7  < qŒ| d¡�s\J ‚| dt|ƒ |dd…  ¡ qŒt|ƒdk�sŽJ ‚d |¡S )aŒ  This formats an explanation

    Normally all embedded newlines are escaped, however there are
    three exceptions: 
{, 
} and 
~.  The first two are intended
    cover nested explanations, see function and attribute explanations
    for examples (.visit_Call(), visit_Attribute()).  The last one is
    for when one explanation needs to span multiple lines, e.g. when
    displaying diffs.
    Ú Ú
r   é   NÚ{Ú}ú~éÿÿÿÿz\nzand   zwhere z +z  )ÚsplitÚ
startswithÚappendÚlenÚpopÚjoin)	ZexplanationZ	raw_linesÚlinesÚlÚresultÚstackZstackcntÚlineÚs© r   úL/home/yuhw/wc/pochoir/venv/lib/python3.9/site-packages/py/_code/assertion.pyÚ_format_explanation   s6    


, r   c                   @   s   e Zd Zdd„ ZdS )ÚAssertionErrorc                 G   s  t j| g|¢R Ž  |rjzt|d ƒ| _W n> tjjy@   ‚ Y n(   d|d jt|d ƒf | _Y n0 n¬tj	 
t d¡¡}zP|j	j}|d urÊz|j|jdd�}W n ty¸   d }Y n0 t| ¡ ƒ ¡ }W n tjjyæ   d }Y n0 |rþt||dd�| _nd| _| j�s| jf| _d S )Nr   z<[broken __repr__] %s at %0xd>r   T)Z	assertion)Zshould_failz!<could not determine information>)ÚBuiltinAssertionErrorÚ__init__ÚstrÚmsgÚpyÚbuiltinZ_sysexÚ	__class__ÚidÚcodeZFrameÚsysÚ	_getframeZ
fullsourceZgetstatementÚlinenoÚ
IndexErrorZdeindentÚstripÚerrorÚENOENTÚreinterpretÚargs)Úselfr*   ÚfÚsourcer   r   r   r   5   s4    ÿ

zAssertionError.__init__N)Ú__name__Ú
__module__Ú__qualname__r   r   r   r   r   r   4   s   r   )é   r   Úbuiltinsz*old reinterpretation not available for py3)Ú	interpret)r"   r   r   r2   r   r   Z_reprcomparer   Úversion_infor/   Zreinterpret_oldZpy._code._assertionoldr3   Zpy._code._assertionnewr)   r   r   r   r   Ú<module>   s   
,!
