summaryrefslogtreecommitdiffstats
path: root/Modules
diff options
context:
space:
mode:
authorGregory P. Smith <greg@mad-scientist.com>2006-01-30 00:22:08 (GMT)
committerGregory P. Smith <greg@mad-scientist.com>2006-01-30 00:22:08 (GMT)
commitfd049a696de28f5f7a8e3ede30ce8bd7d35486ea (patch)
tree13c402e12f2c59e3b6894c0145cd0247c57db1b1 /Modules
parentc26cf5a6f16c7a2e10ed13dcb4daa083981e4d85 (diff)
downloadcpython-fd049a696de28f5f7a8e3ede30ce8bd7d35486ea.zip
cpython-fd049a696de28f5f7a8e3ede30ce8bd7d35486ea.tar.gz
cpython-fd049a696de28f5f7a8e3ede30ce8bd7d35486ea.tar.bz2
maintain support for older python versions in this module so that it
is ok for a standalone pybsddb source dist for use with <= 2.3.
Diffstat (limited to 'Modules')
-rw-r--r--Modules/_bsddb.c16
1 files changed, 16 insertions, 0 deletions
diff --git a/Modules/_bsddb.c b/Modules/_bsddb.c
index f754127..fca203d 100644
--- a/Modules/_bsddb.c
+++ b/Modules/_bsddb.c
@@ -1537,11 +1537,19 @@ DB_pget(DBObject* self, PyObject* args, PyObject* kwargs)
keyObj = PyInt_FromLong(*(int *)key.data);
else
keyObj = PyString_FromStringAndSize(key.data, key.size);
+#if (PY_VERSION_HEX >= 0x02040000)
retval = PyTuple_Pack(3, keyObj, pkeyObj, dataObj);
+#else
+ retval = Py_BuildValue("OOO", keyObj, pkeyObj, dataObj);
+#endif
}
else /* return just the pkey and data */
{
+#if (PY_VERSION_HEX >= 0x02040000)
retval = PyTuple_Pack(2, pkeyObj, dataObj);
+#else
+ retval = Py_BuildValue("OO", pkeyObj, dataObj);
+#endif
}
FREE_DBT(pkey);
FREE_DBT(data);
@@ -3187,12 +3195,20 @@ DBC_pget(DBCursorObject* self, PyObject* args, PyObject *kwargs)
keyObj = PyInt_FromLong(*(int *)key.data);
else
keyObj = PyString_FromStringAndSize(key.data, key.size);
+#if (PY_VERSION_HEX >= 0x02040000)
retval = PyTuple_Pack(3, keyObj, pkeyObj, dataObj);
+#else
+ retval = Py_BuildValue("OOO", keyObj, pkeyObj, dataObj);
+#endif
FREE_DBT(key);
}
else /* return just the pkey and data */
{
+#if (PY_VERSION_HEX >= 0x02040000)
retval = PyTuple_Pack(2, pkeyObj, dataObj);
+#else
+ retval = Py_BuildValue("OO", pkeyObj, dataObj);
+#endif
}
FREE_DBT(pkey);
FREE_DBT(data);