[Python-checkins] r42205 - python/trunk/Modules/_bsddb.c
gregory.p.smith
python-checkins at python.org
Mon Jan 30 01:22:11 CET 2006
Author: gregory.p.smith
Date: Mon Jan 30 01:22:08 2006
New Revision: 42205
Modified:
python/trunk/Modules/_bsddb.c
Log:
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.
Modified: python/trunk/Modules/_bsddb.c
==============================================================================
--- python/trunk/Modules/_bsddb.c (original)
+++ python/trunk/Modules/_bsddb.c Mon Jan 30 01:22:08 2006
@@ -1537,11 +1537,19 @@
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 @@
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);
More information about the Python-checkins
mailing list