mirror of https://github.com/YosysHQ/nextpnr.git
python: Improve general robustness during autocomplete
Signed-off-by: David Shah <dave@ds0.me>
This commit is contained in:
parent
5024fc0690
commit
8f1683246e
|
|
@ -94,7 +94,11 @@ const std::list<std::string> &pyinterpreter_suggest(const std::string &hint)
|
||||||
PyObject *py_result;
|
PyObject *py_result;
|
||||||
PyObject *dum;
|
PyObject *dum;
|
||||||
py_result = Py_CompileString(command.c_str(), "<stdin>", Py_single_input);
|
py_result = Py_CompileString(command.c_str(), "<stdin>", Py_single_input);
|
||||||
|
if (py_result == nullptr)
|
||||||
|
break;
|
||||||
dum = PyEval_EvalCode(py_result, glb, loc);
|
dum = PyEval_EvalCode(py_result, glb, loc);
|
||||||
|
if (dum == nullptr)
|
||||||
|
break;
|
||||||
Py_XDECREF(dum);
|
Py_XDECREF(dum);
|
||||||
Py_XDECREF(py_result);
|
Py_XDECREF(py_result);
|
||||||
res = redirector_take_output(m_threadState);
|
res = redirector_take_output(m_threadState);
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue