Message123238
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 :-) |
|
| Date |
User |
Action |
Args |
| 2010-12-03 12:47:41 | vstinner | set | recipients:
+ vstinner, gregory.p.smith, isandler, amaury.forgeotdarc, pitrou, stutzbach |
| 2010-12-03 12:47:41 | vstinner | set | messageid: <[email protected]> |
| 2010-12-03 12:47:26 | vstinner | link | issue10478 messages |
| 2010-12-03 12:47:26 | vstinner | create | |
|