3
QfX                 @   sV   d Z ddlZG dd deZG dd deZe ZdddZd	d
 Ze	 j
e  dS )z
Exceptions
    Nc               @   s,   e Zd ZdZdd Zdd Zdd ZeZdS )	JoblibExceptionz=A simple exception with an error message that you can get to.c             G   s
   || _ d S )N)args)selfr    r   [/home/psgendb/BIRCHDEV/pkg/SPAdes-3.15.4/linux-x86_64/share/spades/joblib3/my_exceptions.py__init__   s    zJoblibException.__init__c             C   s   | j | ji fS )N)	__class__r   )r   r   r   r   
__reduce__   s    zJoblibException.__reduce__c             C   s<   t | dr| jd }n| j}| jj}d|dd |dd f S )Nr   r   z%s
%s
%s
%sK   _)hasattrr   messager   __name__)r   r   namer   r   r   __repr__   s
    
zJoblibException.__repr__N)r   
__module____qualname____doc__r   r	   r   __str__r   r   r   r   r      s
   r   c               @   s    e Zd ZdZdd Zdd ZdS )TransportableExceptionz`An exception containing all the info to wrap an original
        exception and recreate it.
    c             C   s   || _ || _d S )N)r   etype)r   r   r   r   r   r   r   )   s    zTransportableException.__init__c             C   s   | j | j| jfi fS )N)r   r   r   )r   r   r   r   r	   -   s    z!TransportableException.__reduce__N)r   r   r   r   r   r	   r   r   r   r   r   $   s   r   c             C   sd   |d kr| j }d| }|tkr(t| }n4| tkr8t|fS t|| tfttjtjd}|t|< ||fS )NzJoblib%s)r   r   )r   _exception_mapping	Exceptionr   typedictr   r   )	exceptionr   	this_nameZthis_exceptionr   r   r   _mk_exception5   s    

r   c              C   s   t  } tjd dkr0dd l}tdd t|}ndd l}t|}x\|D ]T}t||}t|t	rFt
|trFyt||d\}}|| |< W qF tk
r   Y qFX qFW | S )Nr      c             S   s
   | j dS )NError)endswith)xr   r   r   <lambda>P   s    z'_mk_common_exceptions.<locals>.<lambda>)r   )r   sysversion_infobuiltinsfilterdir
exceptionsgetattr
isinstancer   
issubclassBaseExceptionr   	TypeError)	namespaceZ_builtin_exceptionsZcommon_exceptionsr   objZthis_objr   r   r   r   _mk_common_exceptionsK   s"    


r0   )N)r   r#   r   r   r   r   r   r   r0   localsupdater   r   r   r   <module>   s   
