Update of /cvsroot/pywin32/pywin32/Pythonwin
In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv1868/pythonwin
Modified Files:
win32cmdui.cpp
Log Message:
Fix callback handler to not check for lingering exception.
Index: win32cmdui.cpp
===================================================================
RCS file: /cvsroot/pywin32/pywin32/Pythonwin/win32cmdui.cpp,v
retrieving revision 1.7
retrieving revision 1.8
diff -C2 -d -r1.7 -r1.8
*** win32cmdui.cpp 13 Nov 2008 04:04:50 -0000 1.7
--- win32cmdui.cpp 13 Nov 2008 04:50:04 -0000 1.8
***************
*** 113,116 ****
--- 113,119 ----
Python_callback (method, ob);
if (PyErr_Occurred()) // if any Python exception, pretend it was OK
+ // XXX - Python_callback always calls
+ // gui_print_error() on failure, which
+ // clears the error - so we can't get here?
gui_print_error();
// object is no longer valid.
***************
*** 139,143 ****
CEnterLeavePython _celp;
rc = Python_callback (method, nID, nCode);
! if (rc==-1 && PyErr_Occurred()) { // if any Python exception, print it
char buf[128];
sprintf(buf, "Error in Command Message handler for command ID %u, Code %d", nID, nCode);
--- 142,150 ----
CEnterLeavePython _celp;
rc = Python_callback (method, nID, nCode);
! // This is dodgy - we have to rely on -1 and can't check PyErr_Occurred(),
! // as Python_callback will have called gui_print_error() which clears
! // the error.
! if (rc==-1) {
! // Raise a *new* exception then print that too.
char buf[128];
sprintf(buf, "Error in Command Message handler for command ID %u, Code %d", nID, nCode);
|