Your IP : 216.73.216.213
B
:��]�k � @ s d Z ddlmZmZmZ ddlZddlZddlZddlZddl Z ddlm
Z
ddlmZ ddl
mZmZ dadZG dd � d e�Zd$dd�Zd
ZG dd� de�Zdd� ZG dd� de�ZG dd� de�ZG dd� de�Zg Zdd� ZG dd� de�Z dd� Z!dZ"dddde j#fd d!�Z$d"d#� Z%dS )%z9
Asynchronous-friendly error mechanism.
See L{Failure}.
� )�division�absolute_import�print_functionN)�getmro)�reflect)�_PY3�NativeStringIO� c @ s e Zd ZdS )�DefaultExceptionN)�__name__�
__module__�__qualname__� r r �I/opt/alt/python37/lib64/python3.7/site-packages/twisted/python/failure.pyr
s r
�defaultc C sp |dkrt d|f ��|}|dkrPx(| D ] \}}}}}|d|||f � q(W �n|dkr�x@| D ]8\}}}}}|d|||f � |dt�||��� � q^W n�|dkr�x(| D ] \}}}}}|d |||f � q�W |d
� n�|dk�rlx�| D ]�\}}}}}|d |||f � |d� x&|D ]\} }
|d
| t|
�f � �qW |d� x&|D ]\} }
|d
| t|
�f � �qFW q�W dS )a�
Format and write frames.
@param frames: is a list of frames as used by Failure.frames, with
each frame being a list of
(funcName, fileName, lineNumber, locals.items(), globals.items())
@type frames: list
@param write: this will be called with formatted strings.
@type write: callable
@param detail: Four detail levels are available:
default, brief, verbose, and verbose-vars-not-captured.
C{Failure.printDetailedTraceback} uses the latter when the caller asks
for verbose, but no vars were captured, so that an explicit warning
about the missing data is shown.
@type detail: string
)r �brief�verbosezverbose-vars-not-capturedzNDetail must be default, brief, verbose, or verbose-vars-not-captured. (not %r)r z %s:%s:%s
r z File "%s", line %s, in %s
z %s
zverbose-vars-not-capturedz%s:%d: %s(...)
zA [Capture of Locals and Globals disabled (use captureVars=True)]
r z [ Locals ]
z
%s : %s
z
( Globals )
N)�
ValueError� linecache�getline�strip�repr)�frames�write�detail�w�method�filename�linenoZ localVarsZ
globalVars�name�valr r r �
format_frames# s2
r! z--- <exception caught here> ---c @ s e Zd ZdZdS )�NoCurrentExceptionErrorz�
Raised when trying to create a Failure from the current interpreter
exception state and there is no current exception state.
N)r r r
�__doc__r r r r r"