B
    |b&                 @   sN   d Z G dd deZG dd deZe Zd
ddZdd	 Ze 	e  dS )zK
Exceptions

This module is deprecated and will be removed in joblib 0.16.
c               @   s$   e Zd Z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   t j| f|  d S )N)	Exception__init__)selfargs r   c/home/ankuromar296_gmail_com/.local/lib/python3.7/site-packages/joblib/_deprecated_my_exceptions.pyr      s    zJoblibException.__init__c             C   s@   t | dr$t| jdkr$| jd }nd}| jj}d|d|df S )Nr        z%s
%s
%s
%sZK___________________________________________________________________________)hasattrlenr   	__class____name__)r   messagenamer   r   r   __repr__   s
    zJoblibException.__repr__N)r   
__module____qualname____doc__r   r   __str__r   r   r   r   r      s   	r   c               @   s"   e Zd ZdZdd ZdddZdS )	TransportableExceptionz`An exception containing all the info to wrap an original
        exception and recreate it.
    c             C   s   t | || || _|| _d S )N)r   r   r   etype)r   r   r   r   r   r   r   ,   s    zTransportableException.__init__r	   c             C   s$   d|| j f }t| jd }||S )Nz%s
---------------------------------------------------------------------------
Joblib worker traceback:
---------------------------------------------------------------------------
%sr   )r   _mk_exceptionr   )r   Zcontext_messagereportZexception_typer   r   r   unwrap3   s    zTransportableException.unwrapN)r	   )r   r   r   r   r   r   r   r   r   r   r   '   s   r   Nc             C   s   t | tr| | jfS |d kr"| j}d| }|tkr<t| }nF| tkrLt|fS yt|t| fi }|t|< W n tk
r   t}Y nX ||fS )NzJoblib%s)
issubclassr   r   _exception_mappingr   type	TypeError)	exceptionr   	this_nameZthis_exceptionr   r   r   r   B   s     



r   c              C   sh   t  } dd l}tdd t|}xB|D ]:}t||}t|tr&t|tr&t	||d\}}|| |< q&W | S )Nr   c             S   s
   |  dS )NError)endswith)xr   r   r   <lambda>f       z'_mk_common_exceptions.<locals>.<lambda>)r   )
dictbuiltinsfilterdirgetattr
isinstancer   r   BaseExceptionr   )	namespaceZ_builtin_exceptionsZcommon_exceptionsr   objZthis_objr   r   r   r   _mk_common_exceptionsb   s    


r.   )N)
r   r   r   r   r%   r   r   r.   localsupdater   r   r   r   <module>   s   
 