updated for version 7.3.954
Problem: No check if PyObject_IsTrue fails.
Solution: Add a check for -1 value. (ZyX)
diff --git a/src/if_py_both.h b/src/if_py_both.h
index 9e6c675..4905bed 100644
--- a/src/if_py_both.h
+++ b/src/if_py_both.h
@@ -700,7 +700,10 @@
}
else
{
- if (PyObject_IsTrue(val))
+ int istrue = PyObject_IsTrue(val);
+ if (istrue == -1)
+ return -1;
+ else if (istrue)
this->dict->dv_lock = VAR_LOCKED;
else
this->dict->dv_lock = 0;
@@ -1201,7 +1204,10 @@
}
else
{
- if (PyObject_IsTrue(val))
+ int istrue = PyObject_IsTrue(val);
+ if (istrue == -1)
+ return -1;
+ else if (istrue)
this->list->lv_lock = VAR_LOCKED;
else
this->list->lv_lock = 0;
@@ -1479,7 +1485,10 @@
if (flags & SOPT_BOOL)
{
- r = set_option_value_for(key, PyObject_IsTrue(valObject), NULL,
+ int istrue = PyObject_IsTrue(valObject);
+ if (istrue == -1)
+ return -1;
+ r = set_option_value_for(key, istrue, NULL,
opt_flags, this->opt_type, this->from);
}
else if (flags & SOPT_NUM)