Author vstinner
Recipients amaury.forgeotdarc, gregory.p.smith, isandler, pitrou, stutzbach, vstinner
Date 2010-12-03.12:47:26
SpamBayes Score 1.42008e-09
Marked as misclassified No
Message-id <1291380461.75.0.548882047232.issue10478@psf.upfronthosting.co.za>
In-reply-to
Content
Dummy question: why don't you use KeyboardInterrupt instead of a custom SIGINT handler?

try:
    for i in range(1000000):
        print(i)
except KeyboardInterrupt:
    print("got sigint")

Python SIGINT handler raises a KeyboardInterrupt (the handler is written in C, not in Python) which is safe, whereas writing to sys.stdout doesn't look to be a good idea :-)
History
Date User Action Args
2010-12-03 12:47:41vstinnersetrecipients: + vstinner, gregory.p.smith, isandler, amaury.forgeotdarc, pitrou, stutzbach
2010-12-03 12:47:41vstinnersetmessageid: <1291380461.75.0.548882047232.issue10478@psf.upfronthosting.co.za>
2010-12-03 12:47:26vstinnerlinkissue10478 messages
2010-12-03 12:47:26vstinnercreate