[Python-ideas] IDEA: do not alter default SIGINT handling

Oleg Broytmann phd at phd.pp.ru
Tue Sep 15 15:05:47 CEST 2009


On Tue, Sep 15, 2009 at 02:55:03PM +0200, Georg Brandl wrote:
> Nick Coghlan schrieb:
> > [Greg]
> >>> What do you mean? Ctrl-C interrupts time.sleep()
> >>> okay in my Python (on MacOSX).
> > 
> > [ryles]
> >> it doesn't work on Windows XP.
> > 
> > It is, indeed, Windows. (I didn't realise the *nix based OS's didn't
> > have this problem - an artifact of mostly using Python on Windows,
> > despite the fact that I do my development *of* Python on Linux).
> 
> But looking at timemodule.c, there's lots of code that says it's there
> for "Ctrl+C" events/interruptions on Windows. Did that work at any time?

   Works for me:

C:\Python25>python.exe
Python 2.5.4 (r254:67916, Dec 23 2008, 15:10:54) [MSC v.1310 32 bit (Intel)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> from time import sleep
>>> try: sleep(10)
... except KeyboardInterrupt: print 'QuQu'
... [Hit Ctrl+C]
QuQu
>>>

   WinXP SP2.

Oleg.
-- 
     Oleg Broytmann            http://phd.pp.ru/            phd at phd.pp.ru
           Programmers don't die, they just GOSUB without RETURN.



More information about the Python-ideas mailing list