From 8f1683246ed5493f131a530025d6c076142f6291 Mon Sep 17 00:00:00 2001 From: David Shah Date: Fri, 24 Apr 2020 16:44:30 +0100 Subject: python: Improve general robustness during autocomplete Signed-off-by: David Shah --- 3rdparty/python-console/modified/pyinterpreter.cc | 4 ++++ 1 file changed, 4 insertions(+) (limited to '3rdparty/python-console/modified') diff --git a/3rdparty/python-console/modified/pyinterpreter.cc b/3rdparty/python-console/modified/pyinterpreter.cc index 958049b9..cbb6322f 100644 --- a/3rdparty/python-console/modified/pyinterpreter.cc +++ b/3rdparty/python-console/modified/pyinterpreter.cc @@ -94,7 +94,11 @@ const std::list &pyinterpreter_suggest(const std::string &hint) PyObject *py_result; PyObject *dum; py_result = Py_CompileString(command.c_str(), "", Py_single_input); + if (py_result == nullptr) + break; dum = PyEval_EvalCode(py_result, glb, loc); + if (dum == nullptr) + break; Py_XDECREF(dum); Py_XDECREF(py_result); res = redirector_take_output(m_threadState); -- cgit v1.2.3