Skip to content

Commit 1c93ee9

Browse files
committed
If a python error has occurred, don't try to do any work, just bail
1 parent f41f6a2 commit 1c93ee9

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

qrenderdoc/Code/pyrenderdoc/PythonContext.cpp

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -734,6 +734,9 @@ PyObject *PythonContext::outstream_write(PyObject *self, PyObject *args)
734734
if(!PyArg_ParseTuple(args, "z:write", &text))
735735
return NULL;
736736

737+
if(PyErr_Occurred())
738+
return NULL;
739+
737740
OutputRedirector *redirector = (OutputRedirector *)self;
738741

739742
if(redirector)
@@ -774,6 +777,9 @@ PyObject *PythonContext::outstream_write(PyObject *self, PyObject *args)
774777

775778
PyObject *PythonContext::outstream_flush(PyObject *self, PyObject *args)
776779
{
780+
if(PyErr_Occurred())
781+
return NULL;
782+
777783
Py_RETURN_NONE;
778784
}
779785

0 commit comments

Comments
 (0)