diff options
author | David Shah <dave@ds0.me> | 2020-04-24 16:44:30 +0100 |
---|---|---|
committer | David Shah <dave@ds0.me> | 2020-04-24 16:44:30 +0100 |
commit | 8f1683246ed5493f131a530025d6c076142f6291 (patch) | |
tree | 845014009c45c2bab5d129d19246d0c908bf2bcc /3rdparty | |
parent | 5024fc06905476d9bf49c28350ae9fef83953519 (diff) | |
download | nextpnr-8f1683246ed5493f131a530025d6c076142f6291.tar.gz nextpnr-8f1683246ed5493f131a530025d6c076142f6291.tar.bz2 nextpnr-8f1683246ed5493f131a530025d6c076142f6291.zip |
python: Improve general robustness during autocomplete
Signed-off-by: David Shah <dave@ds0.me>
Diffstat (limited to '3rdparty')
-rw-r--r-- | 3rdparty/python-console/modified/pyinterpreter.cc | 4 |
1 files changed, 4 insertions, 0 deletions
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<std::string> &pyinterpreter_suggest(const std::string &hint) PyObject *py_result; PyObject *dum; py_result = Py_CompileString(command.c_str(), "<stdin>", 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); |