Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 58b2eac

Browse files
committed
Print something on stderr in case of exceptions in callback routines.
1 parent c4f6331 commit 58b2eac

2 files changed

Lines changed: 18 additions & 6 deletions

File tree

Mac/Modules/drag/Dragmodule.c

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -970,8 +970,10 @@ dragglue_TrackingHandler(DragTrackingMessage theMessage, WindowPtr theWindow,
970970
return -1;
971971
rv = PyEval_CallObject((PyObject *)handlerRefCon, args);
972972
Py_DECREF(args);
973-
if ( rv == NULL )
973+
if ( rv == NULL ) {
974+
fprintf(stderr, "Drag: Exception in TrackingHandler\n");
974975
return -1;
976+
}
975977
i = -1;
976978
if ( rv == Py_None )
977979
i = 0;
@@ -993,8 +995,10 @@ dragglue_ReceiveHandler(WindowPtr theWindow, void *handlerRefCon,
993995
return -1;
994996
rv = PyEval_CallObject((PyObject *)handlerRefCon, args);
995997
Py_DECREF(args);
996-
if ( rv == NULL )
998+
if ( rv == NULL ) {
999+
fprintf(stderr, "Drag: Exception in ReceiveHandler\n");
9971000
return -1;
1001+
}
9981002
i = -1;
9991003
if ( rv == Py_None )
10001004
i = 0;
@@ -1019,8 +1023,10 @@ dragglue_SendData(FlavorType theType, void *dragSendRefCon,
10191023
return -1;
10201024
rv = PyEval_CallObject(self->sendproc, args);
10211025
Py_DECREF(args);
1022-
if ( rv == NULL )
1026+
if ( rv == NULL ) {
1027+
fprintf(stderr, "Drag: Exception in SendDataHandler\n");
10231028
return -1;
1029+
}
10241030
i = -1;
10251031
if ( rv == Py_None )
10261032
i = 0;

Mac/Modules/drag/dragsupport.py

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -89,8 +89,10 @@
8989
return -1;
9090
rv = PyEval_CallObject((PyObject *)handlerRefCon, args);
9191
Py_DECREF(args);
92-
if ( rv == NULL )
92+
if ( rv == NULL ) {
93+
fprintf(stderr, "Drag: Exception in TrackingHandler\\n");
9394
return -1;
95+
}
9496
i = -1;
9597
if ( rv == Py_None )
9698
i = 0;
@@ -112,8 +114,10 @@
112114
return -1;
113115
rv = PyEval_CallObject((PyObject *)handlerRefCon, args);
114116
Py_DECREF(args);
115-
if ( rv == NULL )
117+
if ( rv == NULL ) {
118+
fprintf(stderr, "Drag: Exception in ReceiveHandler\\n");
116119
return -1;
120+
}
117121
i = -1;
118122
if ( rv == Py_None )
119123
i = 0;
@@ -138,8 +142,10 @@
138142
return -1;
139143
rv = PyEval_CallObject(self->sendproc, args);
140144
Py_DECREF(args);
141-
if ( rv == NULL )
145+
if ( rv == NULL ) {
146+
fprintf(stderr, "Drag: Exception in SendDataHandler\\n");
142147
return -1;
148+
}
143149
i = -1;
144150
if ( rv == Py_None )
145151
i = 0;

0 commit comments

Comments
 (0)