[Python-checkins] r63714 - python/trunk/Modules/_bsddb.c
gregory.p.smith
python-checkins at python.org
Mon May 26 21:03:35 CEST 2008
Author: gregory.p.smith
Date: Mon May 26 21:03:35 2008
New Revision: 63714
Log:
Define macros so that this still compiles on Python prior to r63675.
Modified:
python/trunk/Modules/_bsddb.c
Modified: python/trunk/Modules/_bsddb.c
==============================================================================
--- python/trunk/Modules/_bsddb.c (original)
+++ python/trunk/Modules/_bsddb.c Mon May 26 21:03:35 2008
@@ -104,6 +104,17 @@
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 */
More information about the Python-checkins
mailing list