1266 static PyObject *
1267 bucket_setdefault(Bucket *self, PyObject *args)
1268 {
1269 PyObject *key;
1270 PyObject *failobj; /* default */
1271 PyObject *value; /* return value */
1272 int dummy_changed; /* in order to call _bucket_set */
1273
1274 if (! PyArg_UnpackTuple(args, "setdefault", 2, 2, &key, &failobj))
when PyArg_UnpackTuple() successfully unpacks 2 argument(s)
taking False path
1275 return NULL;
1276
1277 value = _bucket_get(self, key, 0);
when _bucket_get() fails
thread-local exception state now has value: (struct PyObject *)&RegionForGlobal(gcc.VarDecl('PyExc_MemoryError')) from src/BTrees/BucketTemplate.c:1277
1278 if (value != NULL)
taking False path
1279 return value;
1280
1281 /* The key isn't in the bucket. If that's not due to a KeyError exception,
1282 * pass back the unexpected exception.
1283 */
1284 if (! PyErr_ExceptionMatches(PyExc_KeyError))
when considering range: -0x80000000 <= value <= -1
taking False path
1285 return NULL;
1286 PyErr_Clear();
calling PyErr_Clear()
thread-local exception state now has value: (struct PyObject *)0 from src/BTrees/BucketTemplate.c:1286
1287
1288 /* Associate `key` with `failobj` in the bucket, and return `failobj`. */
1289 value = failobj;
1290 if (_bucket_set(self, key, failobj, 0, 0, &dummy_changed) < 0)
when considering range: -0x80000000 <= value <= -1
taking True path
1291 value = NULL;
1292 Py_XINCREF(value);
taking True path
1293 return value;
1294 }
returning (PyObject*)NULL without setting an exception
found 1 similar trace(s) to this