J0mh1 BdZddlZddlZGddejZy)zIEnhanced Thread with support for return values and exception propagation.Nc0eZdZdZddZdZdZdZdZy) REThreadzThread with return values and exception propagation. The thread is marked as daemon thread. The entire Python program exits when no alive non-daemon threads are left. Nc |i}tjj||||||d||_||_||_d|_d|_y)zF!!$vtT6RV!W    c|jr- |j|ji|j|_yy#t$r$t rt j |_YyYywxYw)z9Run target function, identical to threading.Thread.run().N)r r r r BaseExceptionsysexc_inforrs rrunz REThread.run&sX == 5,t}}dkkKT]]K  ! 5&)llnDO 5s+;(A('A(cZ|jrJ|jrJ|jS)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_aliverr rs r return_valuezREThread.return_value/s* ==?""??""||rc|jS)zAReturn (type, value, traceback) of the exception caught in run().)rrs rrzREThread.exc_info9s rcr|jr+|jdj|jdy)zbRaise the exception caught in the thread. Do nothing if no exception was caught. N)rwith_tracebackrs r exc_raisezREThread.exc_raise=s3 ??//!$33DOOA4FG G r)NNNN) __name__ __module__ __qualname____doc__r rrrr%r&rrrrs! 5Hrr)r*rrrrr&rrr+s$O 0Hy0Hr