Your IP : 18.117.119.34


Current Path : /opt/alt/python33/lib64/python3.3/__pycache__/
Upload File :
Current File : //opt/alt/python33/lib64/python3.3/__pycache__/traceback.cpython-33.pyc

�
��f�.c
@s�dZddlZddlZddddddd	d
ddd
ddg
Zdddd�Zddd�Zdd�Zdddd�Zddd	�Z	ddd�Z
dZdZdddd�Z
ddd+dd�Zdd+dd�Zd d�Zd!d"�Zd#d$�Zddd+d%d
�Zdd+d&d�Zddd+d'd
�Zdddd(d�Zddd)d�Zddd*d�ZdS(,u@Extract, format and print information about Python stack traces.iNu
extract_stacku
extract_tbuformat_exceptionuformat_exception_onlyuformat_listuformat_stacku	format_tbu	print_excu
format_excuprint_exceptionu
print_lastuprint_stackuprint_tbuu
cCs|j||�dS(N(uwrite(ufileustru
terminator((u./opt/alt/python33/lib64/python3.3/traceback.pyu_printsu_printcCss|dkrtj}nxT|D]L\}}}}t|d|||f�|rt|d|j��qqWdS(uyPrint the list of tuples as returned by extract_tb() or
    extract_stack() as a formatted stack trace to the given file.u  File "%s", line %d, in %su    %sN(uNoneusysustderru_printustrip(uextracted_listufileufilenameulinenounameuline((u./opt/alt/python33/lib64/python3.3/traceback.pyu
print_listsu
print_listcCsdg}xW|D]O\}}}}d|||f}|rO|d|j�}n|j|�q
W|S(u�Format a list of traceback entry tuples for printing.

    Given a list of tuples as returned by extract_tb() or
    extract_stack(), return a list of strings ready for printing.
    Each string in the resulting list corresponds to the item with the
    same index in the argument list.  Each string ends in a newline;
    the strings may contain internal newlines as well, for those items
    whose source text line is not None.
    u  File "%s", line %d, in %s
u    %s
(ustripuappend(uextracted_listulistufilenameulinenounameulineuitem((u./opt/alt/python33/lib64/python3.3/traceback.pyuformat_lists
c
Cs|dkrtj}n|dkrBttd�rBtj}qBnd}x�|dk	r|dkso||kr|j}|j}|j}|j}|j	}t
|d|||f�tj|�tj
|||j�}	|	r�t
|d|	j��n|j}|d}qKWdS(uPrint up to 'limit' stack trace entries from the traceback 'tb'.

    If 'limit' is omitted or None, all entries are printed.  If 'file'
    is omitted or None, the output goes to sys.stderr; otherwise
    'file' should be an open file or file-like object with a write()
    method.
    utracebacklimitiu  File "%s", line %d, in %su    iN(uNoneusysustderruhasattrutracebacklimitutb_frameu	tb_linenouf_codeuco_filenameuco_nameu_printu	linecacheu
checkcacheugetlineu	f_globalsustriputb_next(
utbulimitufileunufulinenoucoufilenameunameuline((u./opt/alt/python33/lib64/python3.3/traceback.pyuprint_tb-s('					
	cCstt||��S(u5A shorthand for 'format_list(extract_tb(tb, limit))'.(uformat_listu
extract_tb(utbulimit((u./opt/alt/python33/lib64/python3.3/traceback.pyu	format_tbIsc
Cs�|dkr*ttd�r*tj}q*ng}d}x�|dk	r�|dks]||kr�|j}|j}|j}|j}|j}t	j
|�t	j|||j�}	|	r�|	j
�}	nd}	|j||||	f�|j}|d}q9W|S(u�Return list of up to limit pre-processed entries from traceback.

    This is useful for alternate formatting of stack traces.  If
    'limit' is omitted or None, all entries are extracted.  A
    pre-processed stack trace entry is a quadruple (filename, line
    number, function name, text) representing the information that is
    usually printed for a stack trace.  The text is a string with
    leading and trailing whitespace stripped; if the source is not
    available it is None.
    utracebacklimitiiN(uNoneuhasattrusysutracebacklimitutb_frameu	tb_linenouf_codeuco_filenameuco_nameu	linecacheu
checkcacheugetlineu	f_globalsustripuappendutb_next(
utbulimitulistunufulinenoucoufilenameunameuline((u./opt/alt/python33/lib64/python3.3/traceback.pyu
extract_tbMs('					
	uF
The above exception was the direct cause of the following exception:
uE
During handling of the above exception, another exception occurred:
ccs%|dkrt�}n|j|�g}|j}|j}|dk	r�||kr�|jt|d|��|jtdfg�nT|dk	r�|j	r�||kr�|jt|d|��|jt
dfg�n|j||p�|jfg�x$|D]}x|D]}|VqWqWdS(NF(uNoneusetuaddu__context__u	__cause__uappendu_iter_chainuFalseu_cause_messageu__suppress_context__u_context_messageu
__traceback__(uexcu	custom_tbuseenuitsucontextucauseuitux((u./opt/alt/python33/lib64/python3.3/traceback.pyu_iter_chainus$
		


u_iter_chainc	Cs�|dkrtj}n|r0t||�}n||fg}x�|D]�\}}t|t�rtt||�qFn|r�t|d�t|||�ntt	|�|�}x|D]}t||d�q�WqFWdS(u�Print exception up to 'limit' stack trace entries from 'tb' to 'file'.

    This differs from print_tb() in the following ways: (1) if
    traceback is not None, it prints a header "Traceback (most recent
    call last):"; (2) it prints the exception type and value after the
    stack trace; (3) if type is SyntaxError and value has the
    appropriate format, it prints the line where the syntax error
    occurred with a caret on the next line indicating the approximate
    position of the error.
    u"Traceback (most recent call last):uN(
uNoneusysustderru_iter_chainu
isinstanceustru_printuprint_tbuformat_exception_onlyutype(	uetypeuvalueutbulimitufileuchainuvaluesulinesuline((u./opt/alt/python33/lib64/python3.3/traceback.pyuprint_exception�s


cCs�g}|rt||�}n||fg}x�|D]z\}}t|t�rf|j|d�q4n|r�|jd�|jt||��n|jtt|�|��q4W|S(uzFormat a stack trace and the exception information.

    The arguments have the same meaning as the corresponding arguments
    to print_exception().  The return value is a list of strings, each
    ending in a newline and some containing internal newlines.  When
    these lines are concatenated and printed, exactly the same text is
    printed as does print_exception().
    u
u#Traceback (most recent call last):
(u_iter_chainu
isinstanceustruappenduextendu	format_tbuformat_exception_onlyutype(uetypeuvalueutbulimituchainulistuvalues((u./opt/alt/python33/lib64/python3.3/traceback.pyuformat_exception�s	
 cCs�|d
krt||�gS|j}|j}|dkrK|d|}nt|t�sjt||�gSg}|jp|d}t|j�p�d}|j	d||f�|j
}|j}|d
k	r]|j	d|j��|d
k	r]|j
d�}	tt|	�|�d	}|	d
|�j�}	dd�|	D�}	|j	d
dj|	��q]n|jpid}
|j	d||
f�|S(uFormat the exception part of a traceback.

    The arguments are the exception type and value such as given by
    sys.last_type and sys.last_value. The return value is a list of
    strings, each ending in a newline.

    Normally, the list contains a single string; however, for
    SyntaxError exceptions, it contains several lines that (when
    printed) display detailed information about where the syntax
    error occurred.

    The message indicating which exception occurred is always the last
    string in the list.

    u__main__ubuiltinsu.u<string>u?u  File "%s", line %s
u    %s
u
iNcss'|]}|j�r|pdVqdS(u N(uisspace(u.0uc((u./opt/alt/python33/lib64/python3.3/traceback.pyu	<genexpr>�su(format_exception_only.<locals>.<genexpr>u    %s^
uu<no detail available>u%s: %s
(u__main__ubuiltins(uNoneu_format_final_exc_lineu__name__u
__module__u
issubclassuSyntaxErrorufilenameustrulinenouappendutextuoffsetustripurstripuminulenulstripujoinumsg(uetypeuvalueustypeusmodulinesufilenameulinenoubadlineuoffsetu
caretspaceumsg((u./opt/alt/python33/lib64/python3.3/traceback.pyuformat_exception_only�s2				 cCs@t|�}|dks|r,d|}nd||f}|S(Nu%s
u%s: %s
(u	_some_struNone(uetypeuvalueuvaluestruline((u./opt/alt/python33/lib64/python3.3/traceback.pyu_format_final_exc_line�s

u_format_final_exc_linec	Cs.yt|�SWndt|�jSYnXdS(Nu<unprintable %s object>(ustrutypeu__name__(uvalue((u./opt/alt/python33/lib64/python3.3/traceback.pyu	_some_str�su	_some_strc
Cs`|dkrtj}nz2tj�\}}}t||||||�Wdd}}}XdS(u>Shorthand for 'print_exception(*sys.exc_info(), limit, file)'.N(uNoneusysustderruexc_infouprint_exception(ulimitufileuchainuetypeuvalueutb((u./opt/alt/python33/lib64/python3.3/traceback.pyu	print_exc�sc
CsNz8tj�\}}}djt|||||��SWdd}}}XdS(u%Like print_exc() but return a string.uN(usysuexc_infoujoinuformat_exceptionuNone(ulimituchainuetypeuvalueutb((u./opt/alt/python33/lib64/python3.3/traceback.pyu
format_exc
s
cCs\ttd�std��n|dkr6tj}nttjtjtj|||�dS(unThis is a shorthand for 'print_exception(sys.last_type,
    sys.last_value, sys.last_traceback, limit, file)'.u	last_typeuno last exceptionN(	uhasattrusysu
ValueErroruNoneustderruprint_exceptionu	last_typeu
last_valueulast_traceback(ulimitufileuchain((u./opt/alt/python33/lib64/python3.3/traceback.pyu
print_lastscCs^|dkrDy
t�WqDtk
r@tj�djj}YqDXntt||�|�dS(u�Print a stack trace from its invocation point.

    The optional 'f' argument can be used to specify an alternate
    stack frame at which to start. The optional 'limit' and 'file'
    arguments have the same meaning as for print_exception().
    iN(uNoneuZeroDivisionErrorusysuexc_infoutb_frameuf_backu
print_listu
extract_stack(ufulimitufile((u./opt/alt/python33/lib64/python3.3/traceback.pyuprint_stacks

cCsW|dkrDy
t�WqDtk
r@tj�djj}YqDXntt||��S(u5Shorthand for 'format_list(extract_stack(f, limit))'.iN(uNoneuZeroDivisionErrorusysuexc_infoutb_frameuf_backuformat_listu
extract_stack(ufulimit((u./opt/alt/python33/lib64/python3.3/traceback.pyuformat_stack-s

c	CsC|dkrDy
t�WqDtk
r@tj�djj}YqDXn|dkrnttd�rntj}qnng}d}x�|dk	r4|dks�||kr4|j}|j	}|j
}|j}tj
|�tj|||j�}|r�|j�}nd}|j||||f�|j}|d}q}W|j�|S(usExtract the raw traceback from the current stack frame.

    The return value has the same format as for extract_tb().  The
    optional 'f' and 'limit' arguments have the same meaning as for
    print_stack().  Each item in the list is a quadruple (filename,
    line number, function name, text), and the entries are in order
    from oldest to newest stack frame.
    iutracebacklimitiiN(uNoneuZeroDivisionErrorusysuexc_infoutb_frameuf_backuhasattrutracebacklimituf_linenouf_codeuco_filenameuco_nameu	linecacheu
checkcacheugetlineu	f_globalsustripuappendureverse(	ufulimitulistunulinenoucoufilenameunameuline((u./opt/alt/python33/lib64/python3.3/traceback.pyu
extract_stack6s2	

'				
	
T(u__doc__u	linecacheusysu__all__u_printuNoneu
print_listuformat_listuprint_tbu	format_tbu
extract_tbu_cause_messageu_context_messageu_iter_chainuTrueuprint_exceptionuformat_exceptionuformat_exception_onlyu_format_final_exc_lineu	_some_stru	print_excu
format_excu
print_lastuprint_stackuformat_stacku
extract_stack(((u./opt/alt/python33/lib64/python3.3/traceback.pyu<module>s4		!1
	

?>