From 1c93ee9441df457ea0227ded029743d09f344dc6 Mon Sep 17 00:00:00 2001 From: baldurk Date: Thu, 3 Aug 2017 16:16:32 +0100 Subject: [PATCH] If a python error has occurred, don't try to do any work, just bail --- qrenderdoc/Code/pyrenderdoc/PythonContext.cpp | 6 ++++++ 1 file changed, 6 insertions(+) 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; }