##// END OF EJS Templates
parsers: use PyTuple_New and SET_ITEM to construct metadata pair of markers...
Yuya Nishihara -
r26214:46605888 default
parent child Browse files
Show More
@@ -2636,17 +2636,15 static PyObject *fm1readmarker(const cha
2636 metasize = (unsigned char)(*data++);
2636 metasize = (unsigned char)(*data++);
2637 right = PyString_FromStringAndSize(meta, metasize);
2637 right = PyString_FromStringAndSize(meta, metasize);
2638 meta += metasize;
2638 meta += metasize;
2639 if (!left || !right) {
2639 tmp = PyTuple_New(2);
2640 if (!left || !right || !tmp) {
2640 Py_XDECREF(left);
2641 Py_XDECREF(left);
2641 Py_XDECREF(right);
2642 Py_XDECREF(right);
2643 Py_XDECREF(tmp);
2642 goto bail;
2644 goto bail;
2643 }
2645 }
2644 tmp = PyTuple_Pack(2, left, right);
2646 PyTuple_SET_ITEM(tmp, 0, left);
2645 Py_DECREF(left);
2647 PyTuple_SET_ITEM(tmp, 1, right);
2646 Py_DECREF(right);
2647 if (!tmp) {
2648 goto bail;
2649 }
2650 PyTuple_SET_ITEM(metadata, i, tmp);
2648 PyTuple_SET_ITEM(metadata, i, tmp);
2651 }
2649 }
2652 ret = Py_BuildValue("(OOHO(di)O)", prec, succs, flags,
2650 ret = Py_BuildValue("(OOHO(di)O)", prec, succs, flags,
General Comments 0
You need to be logged in to leave comments. Login now