]> git.michaelhowe.org Git - packages/b/bup.git/commitdiff
Use PyLong_FromUnsignedLong instead of Py_BuildValue("I")
authorAvery Pennarun <apenwarr@gmail.com>
Fri, 3 Dec 2010 19:08:03 +0000 (11:08 -0800)
committerAvery Pennarun <apenwarr@gmail.com>
Fri, 3 Dec 2010 19:08:47 +0000 (11:08 -0800)
...for python-pre-2.4.3 compatibility.  The "I" option was broken before
python 2.4.3, even though it was supposed to be supported since python 2.3.

Reported by Michael Budde.

Signed-off-by: Avery Pennarun <apenwarr@gmail.com>
lib/bup/_helpers.c

index 7a144d24baabfe6ff3799856b3f4da114077f37d..40235ee3ed105b06c7334cff736f14ce6b9b6b3f 100644 (file)
@@ -73,7 +73,7 @@ static PyObject *firstword(PyObject *self, PyObject *args)
        return NULL;
     
     v = ntohl(*(uint32_t *)buf);
-    return Py_BuildValue("I", v);
+    return PyLong_FromUnsignedLong(v);
 }
 
 
@@ -92,7 +92,7 @@ static PyObject *extract_bits(PyObject *self, PyObject *args)
     mask = (1<<nbits) - 1;
     v = ntohl(*(uint32_t *)buf);
     v = (v >> (32-nbits)) & mask;
-    return Py_BuildValue("I", v);
+    return PyLong_FromUnsignedLong(v);
 }