From b2b6bf5d561f6c0a2b42db215dc177bc61423c56 Mon Sep 17 00:00:00 2001 From: Panu Matilainen Date: Tue, 26 Mar 2013 12:34:27 +0200 Subject: [PATCH] Accept Python longs as db instance number too - Prior to this, trying to retrieve a db instance by number gotten from header['dbinstance'] would fail with unknown key type, doh. (cherry picked from commit 409fb9daea495fb88b9cecaa0a053ad738a625cf) --- python/rpmts-py.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/python/rpmts-py.c b/python/rpmts-py.c index 12f7498..181e9f6 100644 --- a/python/rpmts-py.c +++ b/python/rpmts-py.c @@ -609,6 +609,10 @@ rpmts_Match(rpmtsObject * s, PyObject * args, PyObject * kwds) lkey = PyInt_AsLong(Key); key = (char *)&lkey; len = sizeof(lkey); + } else if (PyLong_Check(Key)) { + lkey = PyLong_AsLong(Key); + key = (char *)&lkey; + len = sizeof(lkey); } else if (utf8FromPyObject(Key, &str)) { key = PyBytes_AsString(str); len = PyBytes_Size(str); -- 2.7.4