File: src/BTrees/BucketTemplate.c
Function: bucket_pop
Error: returning (PyObject*)NULL without setting an exception
1301 static PyObject *
1302 bucket_pop(Bucket *self, PyObject *args)
1303 {
1304     PyObject *key;
1305     PyObject *failobj = NULL; /* default */
1306     PyObject *value;          /* return value */
1307     int dummy_changed;        /* in order to call _bucket_set */
1308 
1309     if (! PyArg_UnpackTuple(args, "pop", 1, 2, &key, &failobj))
when PyArg_UnpackTuple() successfully unpacks 1 argument(s)
taking False path
1310     	return NULL;
1311 
1312     value = _bucket_get(self, key, 0);
when _bucket_get() succeeds
1313     if (value != NULL) {
taking True path
1314         /* Delete key and associated value. */
1315         if (_bucket_set(self, key, NULL, 0, 0, &dummy_changed) < 0) {
when considering range: -0x80000000 <= value <= -1
taking True path
1316             Py_DECREF(value);
when taking True path
1317             return NULL;
1318         }
1319         return value;
1320     }
1321 
1322     /* The key isn't in the bucket.  If that's not due to a KeyError exception,
1323      * pass back the unexpected exception.
1324      */
1325     if (! PyErr_ExceptionMatches(PyExc_KeyError))
1326         return NULL;
1327 
1328     if (failobj != NULL) {
1329     	/* Clear the KeyError and return the explicit default. */
1330     	PyErr_Clear();
1331     	Py_INCREF(failobj);
1332     	return failobj;
1333     }
1334 
1335     /* No default given.  The only difference in this case is the error
1336      * message, which depends on whether the bucket is empty.
1337      */
1338     if (Bucket_length(self) == 0)
1339         PyErr_SetString(PyExc_KeyError, "pop(): Bucket is empty");
1340     return NULL;
1341  }
returning (PyObject*)NULL without setting an exception
found 3 similar trace(s) to this