mirror of
https://github.com/worldforge/cyphesis
synced 2026-08-13 12:26:04 -04:00
Clear error status after calling PyObject_Generic?etAttr methods.
This commit is contained in:
parent
9f0eca45b0
commit
2d3bb5b30e
3 changed files with 8 additions and 1 deletions
|
|
@ -69,7 +69,10 @@ void PythonArithmeticScript::set(const std::string & name, const float & val)
|
|||
{
|
||||
PyObject * pn = PyString_FromString(name.c_str());
|
||||
PyObject * py_val = PyFloat_FromDouble(val);
|
||||
PyObject_GenericSetAttr(m_script, pn, py_val);
|
||||
if (PyObject_GenericSetAttr(m_script, pn, py_val) == 0) {
|
||||
// PyObject_GenericSetAttr sets and error if nothing was found
|
||||
PyErr_Clear();
|
||||
}
|
||||
Py_DECREF(pn);
|
||||
Py_DECREF(py_val);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue