@@ -197,6 +197,13 @@ Object Protocol
197197 in favour of using :c:func: `PyObject_DelAttr `, but there are currently no
198198 plans to remove it.
199199
200+ The function must not be called with ``NULL `` *v * and an an exception set.
201+ This case can arise from forgetting ``NULL `` checks and would delete the
202+ attribute.
203+
204+ .. versionchanged :: next
205+ Must not be called with NULL value if an exception is set.
206+
200207
201208.. c :function :: int PyObject_SetAttrString (PyObject *o, const char *attr_name, PyObject *v)
202209
@@ -207,6 +214,10 @@ Object Protocol
207214 If *v * is ``NULL ``, the attribute is deleted, but this feature is
208215 deprecated in favour of using :c:func: `PyObject_DelAttrString `.
209216
217+ The function must not be called with ``NULL `` *v * and an an exception set.
218+ This case can arise from forgetting ``NULL `` checks and would delete the
219+ attribute.
220+
210221 The number of different attribute names passed to this function
211222 should be kept small, usually by using a statically allocated string
212223 as *attr_name *.
@@ -215,6 +226,10 @@ Object Protocol
215226 For more details, see :c:func: `PyUnicode_InternFromString `, which may be
216227 used internally to create a key object.
217228
229+ .. versionchanged :: next
230+ Must not be called with NULL value if an exception is set.
231+
232+
218233.. c :function :: int PyObject_GenericSetAttr (PyObject *o, PyObject *name, PyObject *value)
219234
220235 Generic attribute setter and deleter function that is meant
0 commit comments