Module written in C does not repond to Ctrl-C interruption.

Daniel Dittmar daniel.dittmar at sap.corp
Fri Feb 24 12:45:49 EST 2006


Diez B. Roggisch wrote:
> """
> Although Python signal handlers are called asynchronously as far as the
> Python user is concerned, they can only occur between the ``atomic''
> instructions of the Python interpreter. This means that signals arriving
> during long calculations implemented purely in C (such as regular
> expression matches on large bodies of text) may be delayed for an arbitrary
> amount of time. 
> """
> 
> So - no workaround here, unless you patch python.

You could set up your own signal handler when entering the C extension. 
This should abort the extension (tricky) and call the Python signal handler.

Daniel



More information about the Python-list mailing list