;ò
ÎÑAHc           @   sG   d  Z  d k Z d k Z d k Z d „  Z d e i f d „  ƒ  YZ d S(   sQ   
Thread subclass that can deal with asynchronously function calls via
raise_exc.
Nc         C   s   t  i | ƒ o t d ƒ ‚ n t i i |  t i | ƒ ƒ } | d j o t
 d ƒ ‚ n1 | d j o# t i i |  d ƒ t d ƒ ‚ n d S(   s0   raises the exception, performs cleanup if neededs(   Only types can be raised (not instances)i    s   invalid thread idi   s    PyThreadState_SetAsyncExc failedN(   s   inspects   isclasss   exctypes	   TypeErrors   ctypess	   pythonapis   PyThreadState_SetAsyncExcs   tids	   py_objects   ress
   ValueErrors   SystemError(   s   tids   exctypes   res(    (    sI   /u/d/b/dbachman/=/lib/python2.3/site-packages/IPython/gui/wx/thread_ex.pys   _async_raise   s     s   ThreadExc           B   s#   t  Z d „  Z d „  Z d „  Z RS(   Nc         C   sŠ   |  i ƒ  o t i d ƒ ‚ n t |  d ƒ o |  i Sn x; t i i ƒ  D]* \ } } | |  j o | |  _ | SqL qL Wt
 d ƒ ‚ d S(   s"   determines this (self's) thread ids   the thread is not actives
   _thread_ids#   could not determine the thread's idN(   s   selfs   isAlives	   threadings   ThreadErrors   hasattrs
   _thread_ids   _actives   itemss   tids   tobjs   AssertionError(   s   selfs   tids   tobj(    (    sI   /u/d/b/dbachman/=/lib/python2.3/site-packages/IPython/gui/wx/thread_ex.pys   _get_my_tid   s      	c         C   s   t  |  i ƒ  | ƒ d S(   s=   raises the given exception type in the context of this threadN(   s   _async_raises   selfs   _get_my_tids   exctype(   s   selfs   exctype(    (    sI   /u/d/b/dbachman/=/lib/python2.3/site-packages/IPython/gui/wx/thread_ex.pys	   raise_exc+   s     c         C   s   |  i t ƒ d S(   s}   raises SystemExit in the context of the given thread, which should 
        cause the thread to exit silently (unless caught)N(   s   selfs	   raise_excs
   SystemExit(   s   self(    (    sI   /u/d/b/dbachman/=/lib/python2.3/site-packages/IPython/gui/wx/thread_ex.pys   kill/   s     (   s   __name__s
   __module__s   _get_my_tids	   raise_excs   kill(    (    (    sI   /u/d/b/dbachman/=/lib/python2.3/site-packages/IPython/gui/wx/thread_ex.pys   ThreadEx   s   		(   s   __doc__s	   threadings   inspects   ctypess   _async_raises   Threads   ThreadEx(   s	   threadings   inspects   ctypess   ThreadExs   _async_raise(    (    sI   /u/d/b/dbachman/=/lib/python2.3/site-packages/IPython/gui/wx/thread_ex.pys   ?   s
   				