B
    é¹`f  ã               @   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}xR|dd… D ]B}| d¡sH| d¡sH| d¡rT| |¡ q&|d	  d
| 7  < q&W |dd… }dg}dg}xþ|dd… D ]î}| d¡r|d	 r°d}nd}| t|ƒ¡ |d	  d7  < | d¡ | ddt|ƒd   | |dd…  ¡ q’| d¡rR| d¡s$t‚| ¡  | ¡  ||d	   |dd… 7  < q’| d¡sbt‚| dt|ƒ |dd…  ¡ q’W t|ƒdks–t‚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ÚAssertionErrorÚpopÚjoin)	ZexplanationZ	raw_linesÚlinesÚlÚresultÚstackZstackcntÚlineÚs© r   úZ/home/kop/projects/devel/pgwui/test_venv/lib/python3.7/site-packages/py/_code/assertion.pyÚ_format_explanation   s6    


,"r   c               @   s   e Zd Zdd„ ZdS )r   c             G   s   t j| f|žŽ  |rjyt|d ƒ| _W n@ tjjk
r@   ‚ Y n(   d|d jt|d ƒf | _Y nX n²tj	 
t d¡¡}yR|j	j}|d k	rÌy|j|jdd}W n tk
rº   d }Y nX t| ¡ ƒ ¡ }W n tjjk
rê   d }Y nX |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   s2    "

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   
,!
