diff --git a/qrenderdoc/Code/pyrenderdoc/PythonContext.cpp b/qrenderdoc/Code/pyrenderdoc/PythonContext.cpp index e5bb50571..fa99c72e0 100644 --- a/qrenderdoc/Code/pyrenderdoc/PythonContext.cpp +++ b/qrenderdoc/Code/pyrenderdoc/PythonContext.cpp @@ -734,6 +734,9 @@ PyObject *PythonContext::outstream_write(PyObject *self, PyObject *args) if(!PyArg_ParseTuple(args, "z:write", &text)) return NULL; + if(PyErr_Occurred()) + return NULL; + OutputRedirector *redirector = (OutputRedirector *)self; if(redirector) @@ -774,6 +777,9 @@ PyObject *PythonContext::outstream_write(PyObject *self, PyObject *args) PyObject *PythonContext::outstream_flush(PyObject *self, PyObject *args) { + if(PyErr_Occurred()) + return NULL; + Py_RETURN_NONE; }