Файловый менеджер - Редактировать - /opt/imh-python/lib/python3.9/site-packages/twisted/python/__pycache__/failure.cpython-39.pyc
Ðазад
a k�h�l � @ s d Z ddlZddlZddlZddlZddlZddlmZ ddlmZ ddl Z ddl mZ dadZ G dd� de�Zd#d d�ZdZG d d� de�Zdd� ZG dd� d�ZG dd� d�ZG dd� d�Zg Zdd� ZG dd� de�Zdd� ZdZddddejfdd �Zd!d"� ZdS )$z9 Asynchronous-friendly error mechanism. See L{Failure}. � N)�getmro)�StringIO)�reflect� c @ s e Zd ZdS )�DefaultExceptionN)�__name__� __module__�__qualname__� r r ��/root/rpmbuild/BUILDROOT/imh-python39-modules-3.9.7-92.el8.x86_64/opt/imh-python/lib/python3.9/site-packages/twisted/python/failure.pyr s r �defaultc C sv |dvrt d|f ��|}|dkrT| D ](\}}}}}||� d|� d|� d�� q&�n|dkr�| D ]B\}}}}}|d|� d|� d |� d�� |d t�||��� � q`n�|dkr�| D ] \}}}}}|d|||f � q�|d � n�|dk�rr| D ]�\}}}}}|d|||f � |d� |D ]$\} } |d| � dt| �� d�� �q|d� |D ]$\} } |d| � dt| �� d�� �qJq�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�verbose�verbose-vars-not-capturedzNDetail must be default, brief, verbose, or verbose-vars-not-captured. (not %r)r �:� r z File "z", line z, in z %s r z%s:%d: %s(...) zA [Capture of Locals and Globals disabled (use captureVars=True)] r z [ Locals ] z z : z ( Globals ) N)� ValueError� linecache�getline�strip�repr)�frames�write�detail�w�method�filename�linenoZ localVarsZ globalVars�name�valr r r � format_frames$ s6 �� 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! W s r! c C sv t |�dksJ d��d}| D ]}t||�}qt|d |�}t|� }}|dd� D ]}t||�}t|�|_|j}qR|S )a5 Construct a fake traceback object using a list of frames. It should have the same API as stdlib to allow interaction with other tools. @param stackFrames: [(methodname, filename, lineno, locals, globals), ...] @param tbFrames: [(methodname, filename, lineno, locals, globals), ...] r zMust pass some framesN� )�len�_Frame�_TracebackFrame�tb_next)ZstackFramesZtbFrames�stackZsfZfirstTb�tbr r r � _Traceback^ s r* c @ s e Zd ZdZdd� ZdS )r&