1778 static PyObject *
1779 bitarray_encode(bitarrayobject *self, PyObject *args)
1780 {
1781 PyObject *codedict, *iterable, *iter, *symbol, *bits;
1782
1783 if (!PyArg_ParseTuple(args, "OO:_encode", &codedict, &iterable))
when _PyArg_ParseTuple_SizeT() succeeds
taking False path
1784 return NULL;
1785
1786 iter = PyObject_GetIter(iterable);
when PyObject_GetIter() succeeds
1787 if (iter == NULL) {
taking False path
1788 PyErr_SetString(PyExc_TypeError, "iterable object expected");
1789 return NULL;
1790 }
1791 /* Extend self with the bitarrays from codedict */
1792 while ((symbol = PyIter_Next(iter)) != NULL) {
when PyIter_Next() retrieves a value (new ref)
taking True path
1793 bits = PyDict_GetItem(codedict, symbol);
when PyDict_GetItem() succeeds
1794 if (bits == NULL) {
taking False path
1795 PyErr_SetString(PyExc_ValueError, "symbol not in prefix code");
1796 Py_DECREF(symbol);
1797 Py_DECREF(iter);
1798 return NULL;
1799 }
1800 Py_DECREF(symbol);
when taking True path
1801 if (extend_bitarray(self, (bitarrayobject *) bits) < 0) {
when considering range: -0x80000000 <= value <= -1
taking True path
1802 Py_DECREF(iter);
when taking True path
1803 return NULL;
1804 }
1805 }
1806 Py_DECREF(iter);
1807 if (PyErr_Occurred())
1808 return NULL;
1809
1810 Py_RETURN_NONE;
1811 }
returning (PyObject*)NULL without setting an exception
found 3 similar trace(s) to this