
    !f                     B    d Z ddlZddlZ G d dej                        Zy)zIEnhanced Thread with support for return values and exception propagation.    Nc                   0    e Zd ZdZddZd Zd Zd Zd Zy)	REThreadz4Thread with return values and exception propagation.Nc                     |i }t         j                  j                  | |||||       || _        || _        || _        d| _        d| _        y)z<Initialize Thread, identical to threading.Thread.__init__().N)	threadingThread__init___REThread__target_REThread__args_REThread__kwargs_retval
_exception)selfgrouptargetnameargskwargss         1/usr/lib/python3/dist-packages/apport/REThread.pyr   zREThread.__init__   sM    >F!!$vtT6J    c                     | j                   r-	  | j                   | j                  i | j                  | _        yy# t        $ r$ t
        rt        j                         | _        Y yY yw xY w)z9Run target function, identical to threading.Thread.run().N)r	   r
   r   r   BaseExceptionsysexc_infor   r   s    r   runzREThread.run"   sX    ==5,t}}dkkKT]]K  ! 5&)llnDO 5s   +; (A('A(c                 Z    | j                         rJ | j                  rJ | j                  S )zReturn value from target function.

        This can only be called after the thread has finished, i. e. when
        is_alive() is False and did not terminate with an exception.
        )is_aliver   r   r   s    r   return_valuezREThread.return_value+   s*     ==?""??""||r   c                     | j                   S )zAReturn (type, value, traceback) of the exception caught in run().)r   r   s    r   r   zREThread.exc_info5   s    r   c                 r    | j                   r+| j                   d   j                  | j                   d         y)zbRaise the exception caught in the thread.

        Do nothing if no exception was caught.
              N)r   with_tracebackr   s    r   	exc_raisezREThread.exc_raise9   s3    
 ??//!$33DOOA4FGG r   )NNN N)	__name__
__module____qualname____doc__r   r   r   r   r$   r%   r   r   r   r      s    >
5Hr   r   )r)   r   r   r   r   r%   r   r   <module>r*      s$    O  ,Hy ,Hr   