mirror of
https://github.com/python/cpython
synced 2026-09-29 12:10:30 +03:00
Callback error handling improvements:
- print traceback - don't use fprintf() - clear exception (implied by PyErr_Print())
This commit is contained in:
parent
3e584aaa2a
commit
7d1d396134
2 changed files with 12 additions and 6 deletions
|
|
@ -898,7 +898,8 @@ dragglue_TrackingHandler(DragTrackingMessage theMessage, WindowPtr theWindow,
|
|||
rv = PyEval_CallObject((PyObject *)handlerRefCon, args);
|
||||
Py_DECREF(args);
|
||||
if ( rv == NULL ) {
|
||||
fprintf(stderr, "Drag: Exception in TrackingHandler\n");
|
||||
PySys_WriteStderr("Drag: Exception in TrackingHandler\n");
|
||||
PyErr_Print();
|
||||
return -1;
|
||||
}
|
||||
i = -1;
|
||||
|
|
@ -923,7 +924,8 @@ dragglue_ReceiveHandler(WindowPtr theWindow, void *handlerRefCon,
|
|||
rv = PyEval_CallObject((PyObject *)handlerRefCon, args);
|
||||
Py_DECREF(args);
|
||||
if ( rv == NULL ) {
|
||||
fprintf(stderr, "Drag: Exception in ReceiveHandler\n");
|
||||
PySys_WriteStderr("Drag: Exception in ReceiveHandler\n");
|
||||
PyErr_Print();
|
||||
return -1;
|
||||
}
|
||||
i = -1;
|
||||
|
|
@ -951,7 +953,8 @@ dragglue_SendData(FlavorType theType, void *dragSendRefCon,
|
|||
rv = PyEval_CallObject(self->sendproc, args);
|
||||
Py_DECREF(args);
|
||||
if ( rv == NULL ) {
|
||||
fprintf(stderr, "Drag: Exception in SendDataHandler\n");
|
||||
PySys_WriteStderr("Drag: Exception in SendDataHandler\n");
|
||||
PyErr_Print();
|
||||
return -1;
|
||||
}
|
||||
i = -1;
|
||||
|
|
|
|||
|
|
@ -82,7 +82,8 @@ dragglue_TrackingHandler(DragTrackingMessage theMessage, WindowPtr theWindow,
|
|||
rv = PyEval_CallObject((PyObject *)handlerRefCon, args);
|
||||
Py_DECREF(args);
|
||||
if ( rv == NULL ) {
|
||||
fprintf(stderr, "Drag: Exception in TrackingHandler\\n");
|
||||
PySys_WriteStderr("Drag: Exception in TrackingHandler\\n");
|
||||
PyErr_Print();
|
||||
return -1;
|
||||
}
|
||||
i = -1;
|
||||
|
|
@ -107,7 +108,8 @@ dragglue_ReceiveHandler(WindowPtr theWindow, void *handlerRefCon,
|
|||
rv = PyEval_CallObject((PyObject *)handlerRefCon, args);
|
||||
Py_DECREF(args);
|
||||
if ( rv == NULL ) {
|
||||
fprintf(stderr, "Drag: Exception in ReceiveHandler\\n");
|
||||
PySys_WriteStderr("Drag: Exception in ReceiveHandler\\n");
|
||||
PyErr_Print();
|
||||
return -1;
|
||||
}
|
||||
i = -1;
|
||||
|
|
@ -135,7 +137,8 @@ dragglue_SendData(FlavorType theType, void *dragSendRefCon,
|
|||
rv = PyEval_CallObject(self->sendproc, args);
|
||||
Py_DECREF(args);
|
||||
if ( rv == NULL ) {
|
||||
fprintf(stderr, "Drag: Exception in SendDataHandler\\n");
|
||||
PySys_WriteStderr("Drag: Exception in SendDataHandler\\n");
|
||||
PyErr_Print();
|
||||
return -1;
|
||||
}
|
||||
i = -1;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue