Issue 18411: signal.SIGINT in windows cause process exit directly. (original) (raw)

I wrote those test python code as following:

import signal import time import os

def handler(signum, frame): print "do whatever, like call thread.interrupt_main()" return

signal.signal(signal.SIGINT, handler)

while 1: try: time.sleep(10) except: os.kill(int(os.getpid()), signal.SIGINT) pass

when i excute this test code on windows, the process print "do whatever, like call thread.interrupt_main()", then exit; on linux, it works correctly.

why on windows it not work?