Your IP : 216.73.216.213


Current Path : /opt/alt/python35/lib64/python3.5/site-packages/Cython/Compiler/__pycache__/
Upload File :
Current File : //opt/alt/python35/lib64/python3.5/site-packages/Cython/Compiler/__pycache__/Errors.cpython-35.pyc



Z��Z��@s8ddlmZyddlmZWnek
rDeefZYnXddlZddl	m
Z
ddlmZddl
mZdd	l
mZGd
d�de�ZGdd
�d
e�Zdd�Zdd�Zdd�ZGdd�de�ZGdd�de�ZGdd�de�ZGdd�de�ZGdd�de�ZGdd�de�Zdadadadd d!�Zd"d#�Z d$d%d&�Z!d'd(�Z"dZ#dd)d*�Z$dd+d,�Z%iZ&dd-d.�Z'gZ(d/d0�Z)d1d2d3�Z*d4d5�Z+e
d1d6d7��Z,d8d9�Z-dS):�)�absolute_import)�
basestringN)�contextmanager�)�
open_new_file�)�
DebugFlags)�Optionsc@seZdZdS)�
PyrexErrorN)�__name__�
__module__�__qualname__�rr�I/opt/alt/python35/lib64/python3.5/site-packages/Cython/Compiler/Errors.pyr
sr
c@seZdZdS)�PyrexWarningN)rrr
rrrrrsrcCs�|d}t|t�s*td|��y|j�}Wntk
rTd}YnKXdj|td|dd�|d��}d|d|d	df}d
dd|ddf}|S)
NrzOPlease replace filename strings with Scanning.FileSourceDescriptor instances %rz[unprintable code]
�r�z
...
%s%s^
� rz%s
%s%s
�-�<)�
isinstance�any_string_type�AssertionError�	get_lines�UnicodeDecodeError�join�max)�position�source�F�srrr�contexts


.r!cCs-|r)d|dj�|d|dfSdS)Nz
%s:%d:%d: rrrr)Zget_error_description)rrrr�format_position+sr"cCs;|r7t|�}t|�}d|||p0df}|S)Nz%
Error compiling Cython file:
%s
%s%sr)r"r!)�messagerZpos_strZcontrrr�format_error1s
r$c@s.eZdZdddd�Zdd�ZdS)�CompileErrorNrcCsS||_||_t||�|_d|_tj||j�||f|_dS)NF)r�message_onlyr$�formatted_message�reported�	Exception�__init__�args)�selfrr#rrrr*:s			zCompileError.__init__cCs|jS)N)r')r,rrr�__str__FszCompileError.__str__)rrr
r*r-rrrrr%8sr%c@s"eZdZdddd�ZdS)�CompileWarningNrcCs'||_tj|t|�|�dS)N)rr)r*r")r,rr#rrrr*Ks	zCompileWarning.__init__)rrr
r*rrrrr.Isr.c@seZdZdd�ZdS)�
InternalErrorcCs!||_tj|d|�dS)NzInternal compiler error: %s)r&r)r*)r,r#rrrr*Ts	zInternalError.__init__N)rrr
r*rrrrr/Qsr/c@seZdZdd�ZdS)�
AbortErrorcCs!||_tj|d|�dS)NzAbort error: %s)r&r)r*)r,r#rrrr*\s	zAbortError.__init__N)rrr
r*rrrrr0Ysr0c@seZdZddd�ZdS)�
CompilerCrashNcCs�|rd|}nd}||_|r8d||f}|rjddl}|ddj|j|��7}|r�|s�|d7}|d|jj|f7}tj|||�|||||f|_dS)N�
zCompiler crash in %s%srz/

Compiler crash traceback from this point on:
rz%s: %s)	r&�	tracebackr�	format_tb�	__class__rr%r*r+)r,�posr!r#�causeZ
stacktracer3rrrr*bs"
	
zCompilerCrash.__init__)rrr
r*rrrrr1`sr1c@seZdZdZdS)�NoElementTreeInstalledExceptionzcraised when the user enabled options.gdb_debug but no ElementTree
    implementation was found
    N)rrr
�__doc__rrrrr8xsr8cCsC|dk	rt|�anda|r3tjandadadS)Nr)r�listing_file�sys�stderr�	echo_file�
num_errors)�pathZecho_to_stderrrrr�open_listing_file�sr@cCstrtj�dadS)N)r:�closerrrr�close_listing_file�s
rBTcCs1tr |r tdj|�n
|jr-dSd|_yd|}Wn=tk
r�tt|dd�t|dd��d}YnXtr�ytj|�Wn+tk
r�tj|jdd	��YnXt	ryt	j|�Wn+tk
r
t	j|jdd	��YnXt
d7a
tjr-t
d
��dS)NrTz%s
r&z[unprintable exception message]rr2�ASCII�replacezfatal errors���)�error_stack�appendr(�UnicodeEncodeErrorr$�getattrr:�write�encoder=r>r	Z	fast_failr0)�errZ	use_stack�linerrr�report_error�s.		



	rNcCsJ|dkrt|��t||�}tjr<t|��t|�|S)N)r/r%rZdebug_exception_on_errorr)rN)rr#rLrrr�error�s	
rOcCsS|tkrdSt||�}d|}tr<tj|�trOtj|�|S)Nz	note: %s
)�LEVELr.r:rJr=)rr#�level�warnrMrrrr#�s


r#cCso|tkrdStjr,|r,t||�St||�}d|}trXtj|�trktj|�|S)Nzwarning: %s
)rPr	Zwarning_errorsrOr.r:rJr=)rr#rQrRrMrrr�warning�s



rScCsi|tks|tkrdSt||�}d|}trHtj|�tr[tj|�dt|<|S)Nzwarning: %s
T)rP�_warn_once_seenr.r:rJr=)rr#rQrRrMrrr�	warn_once�s



rUcCstjg�dS)N)rFrGrrrr�hold_errors�srVFcCs1tj�}|s-x|D]}t|�qWdS)N)rF�poprN)�ignore�held_errorsrLrrr�release_errors�s
rZcCstdS)NrrE)rFrrrrrY�srYccs1g}tj|�z	|VWdtd|�XdS)NrX)rFrGrZ)rX�errorsrrr�local_errors�s

	r\cCstj�tdd�=dS)N)rT�clearrFrrrr�resets
r^).�
__future__rZ__builtin__rr�ImportError�bytes�strr;�
contextlibrZUtilsrrrr	r)r
rr!r"r$r%r.r/r0r1r8r:r>r=r@rBrNrOrPr#rSrTrUrFrVrZrYr\r^rrrr�<module>sN