관리-도구
편집 파일: decorators.cpython-38.pyc
U )�e, � @ sb d dl Z d dlmZ d dlmZ ddlmZ G dd� d�Zefdd �Z e Z ZZe d d� �Z dS )� N��wraps)�reraise� )� Tracebackc @ s( e Zd Zdd� Zedd� �Zdd� ZdS )�Errorc C s || _ || _t|�| _d S �N)�exc_type� exc_valuer �_Error__traceback)�selfr r � traceback� r �>/opt/hc_python/lib/python3.8/site-packages/tblib/decorators.py�__init__ s zError.__init__c C s | j �� S r )r Zas_traceback�r r r r r s zError.tracebackc C s t | j| j| j� d S r )r r r r r r r r r s z Error.reraiseN)�__name__� __module__�__qualname__r �propertyr r r r r r r s r c s t ��� �fdd��}|S )Nc s2 z�| |�W S � k r, t t�� � Y S X d S r )r �sys�exc_info)�args�kwargs�r �funcr r �return_exceptions_wrapper s z/return_error.<locals>.return_exceptions_wrapperr )r r r r r r �return_error s r c C s | d | dd� � S )z� args is a tuple where the first argument is a callable. eg:: apply_with_return_error((func, 1, 2, 3)) - this will call func(1, 2, 3) r r Nr )r r r r �apply_with_return_error% s r )r � functoolsr �sixr � r r � Exceptionr Z returns_errorZ return_errorsZreturns_errorsr r r r r �<module> s