
8	Pc           @   s   d  d l  Z  d  d l Z d  d l m Z e Z d e f d     YZ e j   Z	 d   Z
 d   Z d a d   Z d d  Z d S(	   iN(   t   wrapst   _InterruptHandlerc           B   s   e  Z d    Z d   Z RS(   c         C   s   t  |  _ | |  _ d  S(   N(   t   Falset   calledt   default_handler(   t   selfR   (    (    s&   /usr/lib/python2.7/unittest/signals.pyt   __init__
   s    	c         C   s{   t  j t  j  } | |  k	 r1 |  j | |  n  |  j rM |  j | |  n  t |  _ x t j   D] } | j   qc Wd  S(   N(	   t   signalt	   getsignalt   SIGINTR   R   t   Truet   _resultst   keyst   stop(   R   t   signumt   framet   installed_handlert   result(    (    s&   /usr/lib/python2.7/unittest/signals.pyt   __call__   s    		(   t   __name__t
   __module__R   R   (    (    (    s&   /usr/lib/python2.7/unittest/signals.pyR   	   s   	c         C   s   d t  |  <d  S(   Ni   (   R   (   R   (    (    s&   /usr/lib/python2.7/unittest/signals.pyt   registerResult   s    c         C   s   t  t j |  d    S(   N(   t   boolR   t   popt   None(   R   (    (    s&   /usr/lib/python2.7/unittest/signals.pyt   removeResult   s    c          C   sD   t  d  k r@ t j t j  }  t |   a  t j t j t   n  d  S(   N(   t   _interrupt_handlerR   R   R   R	   R   (   R   (    (    s&   /usr/lib/python2.7/unittest/signals.pyt   installHandler#   s    c            sT     d  k	 r+ t      f d    } | St d  k	 rP t j t j t j  n  d  S(   Nc             sE   t  j t  j  } t   z   |  |   SWd  t  j  t  j |  Xd  S(   N(   R   R   R	   t   removeHandler(   t   argst   kwargst   initial(   t   method(    s&   /usr/lib/python2.7/unittest/signals.pyt   inner-   s
    (   R   R    R   R   R	   R   (   R    R!   (    (   R    s&   /usr/lib/python2.7/unittest/signals.pyR   +   s
    (   R   t   weakreft	   functoolsR    R
   t
   __unittestt   objectR   t   WeakKeyDictionaryR   R   R   R   R   R   R   (    (    (    s&   /usr/lib/python2.7/unittest/signals.pyt   <module>   s   			