mς
­fIc           @   sD   d  k  Z  d k l Z d  k Z d   Z e d j o e   n d  S(   N(   s   test_supportc          C   s  x t  t  D]z } | i d  od t t |  } t i o d G| GHn y |   Wq t i j
 o t i	 t
 i   d  q Xq q Wd   } y t i t }  Wn t j
 o t }  n X|  o: |   d  k } | i d |  } | i   | i   n d  S(   Nt   test_t   internali   c             s   d  k    d  k } t i o	 d GHn g      d   } t i |  | }  } | i
 d   i   i    d j o t i d  n d  S(   Ns   auto-thread-statec              s    i   i    d  S(   N(   t   identst   appendt   threadt	   get_ident(    (   R   R   (    t+   /mit/python/lib/python2.4/test/test_capi.pyt   callback   s    i   i   s/   Couldn't find main thread correctly in the list(   R   t   timet   test_supportt   verboseR   R   t	   _testcapit   _test_thread_statet   at   bt   sleept   countR   t
   TestFailed(   R   R   R   R   R   R   (    (   R   R   R   t   TestThreadState   s    		
	
t   target(   t   dirR   t   namet
   startswitht   getattrt   testR	   R
   t   errorR   t   syst   exc_infoR   R   t   Truet   have_thread_statet   AttributeErrort   Falset	   threadingt   Threadt   tt   startt   join(   R   R   R    R   R"   R   (    (    R   t	   test_main   s,     
#	
	
t   __main__(   R   R   R	   R   R%   t   __name__(   R   R	   R   R%   (    (    R   t   ?   s
   			.