summaryrefslogtreecommitdiffstats
path: root/Modules
diff options
context:
space:
mode:
authorGregory P. Smith <greg@mad-scientist.com>2008-05-26 19:03:35 (GMT)
committerGregory P. Smith <greg@mad-scientist.com>2008-05-26 19:03:35 (GMT)
commit572226cad83ce164d6885cc051a79dd57a1dc862 (patch)
tree8d7c58c7596f985cbeaa8c70c25ba84cd9115423 /Modules
parentdacde0d6ae72451ef102aa98ca36b733277d15bb (diff)
downloadcpython-572226cad83ce164d6885cc051a79dd57a1dc862.zip
cpython-572226cad83ce164d6885cc051a79dd57a1dc862.tar.gz
cpython-572226cad83ce164d6885cc051a79dd57a1dc862.tar.bz2
Define macros so that this still compiles on Python prior to r63675.
Diffstat (limited to 'Modules')
-rw-r--r--Modules/_bsddb.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/Modules/_bsddb.c b/Modules/_bsddb.c
index 86b9839..812f233 100644
--- a/Modules/_bsddb.c
+++ b/Modules/_bsddb.c
@@ -104,6 +104,17 @@ static char *rcs_id = "$Id$";
typedef int Py_ssize_t;
#endif
+#if (PY_VERSION_HEX < 0x02060000) /* really: before python trunk r63675 */
+/* This code now uses PyBytes* API function names instead of PyString*.
+ * These #defines map to their equivalent on earlier python versions. */
+#define PyBytes_FromStringAndSize PyString_FromStringAndSize
+#define PyBytes_FromString PyString_FromString
+#define PyBytes_AsStringAndSize PyString_AsStringAndSize
+#define PyBytes_Check PyString_Check
+#define PyBytes_GET_SIZE PyString_GET_SIZE
+#define PyBytes_AS_STRING PyString_AS_STRING
+#endif
+
#ifdef WITH_THREAD
/* These are for when calling Python --> C */