Ticket #51620: patch-no-abort-on-python-errors.diff
File patch-no-abort-on-python-errors.diff, 1.4 KB (added by RJVB (René Bertin), 8 years ago) |
---|
-
qpycore_public_api.cpp
old new 29 29 #include "qpycore_types.h" 30 30 31 31 32 // A replacement for PyErr_Print() that passes the exception to q Fatal().32 // A replacement for PyErr_Print() that passes the exception to qCritical(). 33 33 void pyqt5_err_print() 34 34 { 35 35 #if PY_MAJOR_VERSION >= 3 … … 113 113 PyErr_Restore(exception, value, traceback); 114 114 PyErr_Print(); 115 115 116 // This will be passed to q Fatal() if we can't get the detailed text.116 // This will be passed to qCritical() if we can't get the detailed text. 117 117 QByteArray message("Unhandled Python exception"); 118 118 119 119 // Extract the detailed text if it was redirected. … … 128 128 129 129 if (text) 130 130 { 131 // Strip the text as q Fatal() likes to add a newline.131 // Strip the text as qCritical() likes to add a newline. 132 132 PyObject *stripped = PyObject_CallMethod(text, 133 133 CONST_CAST("strip"), NULL); 134 134 … … 186 186 Py_DECREF(new_stderr); 187 187 } 188 188 189 // q Fatal() maynot call abort.189 // qCritical() will not call abort. 190 190 Py_BEGIN_ALLOW_THREADS 191 q Fatal("%s", message.data());191 qCritical("%s", message.data()); 192 192 Py_END_ALLOW_THREADS 193 193 } 194 194 }