[Pyrex] while loop not detecting ctrl-c
Andreas Kostyrka
andreas at mtg.co.at
Wed Nov 26 11:15:51 CET 2003
On Wed, Nov 26, 2003 at 02:17:13PM +1300, Greg Ewing wrote:
> Bryan Weingarten <bryan.weingarten at pobox.com>:
>
> > i'm not sure i'm understanding what you mean by a default callback. i
> > thought this was what you meant, but it didn't work.
>
> The default callback probably has to be an interpreted Python
> function, not a Pyrex function. The reason is that it's the
> interpreter loop which checks for the flag set by the ctrl-C handler
> and raises a Python exception.
>
> You may have to create an auxiliary Python module containing a
> do-nothing function and import that into the Pyrex module. Not very
> elegant, but it's the best I can think of at the moment without
> delving into the internals of things.
What about a "lambda *args: None" in Pyrex? I mean, that should do the trick in Pyrex too, as Pyrex probably would be forced to generate the lambda object,
right?
Andreas
More information about the Pyrex
mailing list