From: Jack Jansen Date: Fri, 20 Jun 1997 16:19:14 +0000 (+0000) Subject: Adapted to new event handling. It is now also possible to abort out of X-Git-Tag: v1.5a3~333 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=3757523f1e5cc70dbd26fa6ccb8a8a0f421201a0;p=python Adapted to new event handling. It is now also possible to abort out of an AESend with command-. (unless specifically disabled, of course). --- diff --git a/Mac/Modules/ae/AEmodule.c b/Mac/Modules/ae/AEmodule.c index e12c6c87ab..dd4a197ffc 100644 --- a/Mac/Modules/ae/AEmodule.c +++ b/Mac/Modules/ae/AEmodule.c @@ -72,7 +72,12 @@ AEEventHandlerUPP upp_GenericEventHandler; static pascal Boolean AEIdleProc(EventRecord *theEvent, long *sleepTime, RgnHandle *mouseRgn) { - PyMac_Yield(); + if ( PyOS_InterruptOccurred() ) + return 1; + if ( PyMac_HandleEvent(theEvent) < 0 ) { + fprintf(stderr, "Exception in user event handler during AE processing\n"); + PyErr_Clear(); + } return 0; } diff --git a/Mac/Modules/ae/aesupport.py b/Mac/Modules/ae/aesupport.py index 8e4c7a3a44..707e956ad1 100644 --- a/Mac/Modules/ae/aesupport.py +++ b/Mac/Modules/ae/aesupport.py @@ -111,7 +111,12 @@ AEEventHandlerUPP upp_GenericEventHandler; static pascal Boolean AEIdleProc(EventRecord *theEvent, long *sleepTime, RgnHandle *mouseRgn) { - PyMac_Yield(); + if ( PyOS_InterruptOccurred() ) + return 1; + if ( PyMac_HandleEvent(theEvent) < 0 ) { + fprintf(stderr, "Exception in user event handler during AE processing\\n"); + PyErr_Clear(); + } return 0; }