From 0b42a659f8a8159c105d5e2cf11222aa7d80d744 Mon Sep 17 00:00:00 2001 From: Ned Batchelder Date: Sun, 4 Nov 2012 07:35:40 -0500 Subject: Two calls with no error checking replaced by a more convenient Py_BuildValue --- coverage/tracer.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) (limited to 'coverage') diff --git a/coverage/tracer.c b/coverage/tracer.c index 7bc07ea2..97dd113b 100644 --- a/coverage/tracer.c +++ b/coverage/tracer.c @@ -235,10 +235,8 @@ CTracer_record_pair(CTracer *self, int l1, int l2) { int ret = RET_OK; - PyObject * t = PyTuple_New(2); + PyObject * t = Py_BuildValue("(ii)", l1, l2); if (t != NULL) { - PyTuple_SET_ITEM(t, 0, MyInt_FromLong(l1)); - PyTuple_SET_ITEM(t, 1, MyInt_FromLong(l2)); if (PyDict_SetItem(self->cur_file_data, t, Py_None) < 0) { STATS( self->stats.errors++; ) ret = RET_ERROR; -- cgit v1.2.1