ó
ŒwÛjc           @   s
  d  Z  d d l m Z m Z d d l Z d d l Z d d l Z d d l Z e e j e j ƒ Z	 d „  Z
 e	 e
 ƒ Z e j j j Z e	 e j f e _ e j e _ e d k re e d ƒ sÐ d GHe d ƒ n  e j d d e j d ƒ Z d e d	 <x e rqù Wn  d S(
   sY  Script used to test os.kill on Windows, for issue #1220212

This script is started as a subprocess in test_os and is used to test the
CTRL_C_EVENT and CTRL_BREAK_EVENT signals, which requires a custom handler
to be written into the kill target.

See http://msdn.microsoft.com/en-us/library/ms685049%28v=VS.85%29.aspx for a
similar example in C.
iÿÿÿÿ(   t   wintypest   WINFUNCTYPENc         C   s-   |  t  j k r n |  t  j k r$ n d GHd S(   s8   Handle a sig event and return 0 to terminate the processs   UNKNOWN EVENTi    (   t   signalt   CTRL_C_EVENTt   CTRL_BREAK_EVENT(   t   sig(    (    sŽ   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/win_console_handler.pyt   _ctrl_handler   s    t   __main__i   s#   Unable to add SetConsoleCtrlHandlert   1i    (   t   __doc__t   ctypesR    R   R   t   mmapt   syst   BOOLt   DWORDt   HandlerRoutineR   t   ctrl_handlert   windllt   kernel32t   SetConsoleCtrlHandlert   argtypest   restypet   __name__t   exitt   argvt   mt   True(    (    (    sŽ   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/win_console_handler.pyt   <module>	   s&   	

	