File: src/BTrees/BTreeTemplate.c
Function: BTree_setdefault
Error: returning (PyObject*)NULL without setting an exception
1746 static PyObject *
1747 BTree_setdefault(BTree *self, PyObject *args)
1748 {
1749   PyObject *key;
1750   PyObject *failobj; /* default */
1751   PyObject *value;   /* return value */
1752 
1753   if (! PyArg_UnpackTuple(args, "setdefault", 2, 2, &key, &failobj))
when PyArg_UnpackTuple() successfully unpacks 2 argument(s)
taking False path
1754     return NULL;
1755 
1756   value = _BTree_get(self, key, 0);
when _BTree_get() fails
thread-local exception state now has value: (struct PyObject *)&RegionForGlobal(gcc.VarDecl('PyExc_MemoryError')) from src/BTrees/BTreeTemplate.c:1756
1757   if (value != NULL)
taking False path
1758     return value;
1759 
1760   /* The key isn't in the tree.  If that's not due to a KeyError exception,
1761    * pass back the unexpected exception.
1762    */
1763   if (! PyErr_ExceptionMatches(PyExc_KeyError))
when considering range: -0x80000000 <= value <= -1
taking False path
1764     return NULL;
1765   PyErr_Clear();
calling PyErr_Clear()
thread-local exception state now has value: (struct PyObject *)0 from src/BTrees/BTreeTemplate.c:1765
1766 
1767   /* Associate `key` with `failobj` in the tree, and return `failobj`. */
1768   value = failobj;
1769   if (_BTree_set(self, key, failobj, 0, 0) < 0)
when considering range: -0x80000000 <= value <= -1
taking True path
1770     value = NULL;
1771   Py_XINCREF(value);
taking True path
1772   return value;
1773 }
returning (PyObject*)NULL without setting an exception
found 1 similar trace(s) to this