o
    tBh&                     @   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| g|R   d S N)	Exception__init__)selfargs r   w/var/www/html/riverr-enterprise-integrations-main/venv/lib/python3.10/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
%sK___________________________________________________________________________)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 r   )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   context_messagereport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 u r| j}d| }|tv r!t| }||fS | tu r)t|fS zt|t| fi }|t|< W ||fS  tyH   t}Y ||fS w )NzJoblib%s)
issubclassr   r   _exception_mappingr   type	TypeError)	exceptionr   	this_namethis_exceptionr   r   r   r   B   s(   



r   c                  C   sd   t  } dd l}tdd t|}|D ]}t||}t|tr/t|tr/t	||d\}}|| |< q| S )Nr	   c                 S   s
   |  dS )NError)endswith)xr   r   r   <lambda>f   s   
 z'_mk_common_exceptions.<locals>.<lambda>)r   )
dictbuiltinsfilterdirgetattr
isinstancer    r   BaseExceptionr   )	namespace_builtin_exceptionscommon_exceptionsr   objthis_objr#   r   r   r   _mk_common_exceptionsb   s   
r5   r   )
r   r   r   r   r)   r   r   r5   localsupdater   r   r   r   <module>   s    

 