diff options
author | Gregory P. Smith <greg@mad-scientist.com> | 2007-11-05 09:06:28 (GMT) |
---|---|---|
committer | Gregory P. Smith <greg@mad-scientist.com> | 2007-11-05 09:06:28 (GMT) |
commit | fc006692ad99b1f15f5e035ff4bf4d6ad2270805 (patch) | |
tree | 70a71924157fa279de118ff7465ead2e1e003ece | |
parent | ac11e021438def54dbcb2c41f22608caa454889c (diff) | |
download | cpython-fc006692ad99b1f15f5e035ff4bf4d6ad2270805.zip cpython-fc006692ad99b1f15f5e035ff4bf4d6ad2270805.tar.gz cpython-fc006692ad99b1f15f5e035ff4bf4d6ad2270805.tar.bz2 |
* db->get_types is only available in BerkeleyDB >= 4.2
* get compiling with older versions of python again for a stand alone release.
-rw-r--r-- | Modules/_bsddb.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/Modules/_bsddb.c b/Modules/_bsddb.c index d2b62a9..35d4b88 100644 --- a/Modules/_bsddb.c +++ b/Modules/_bsddb.c @@ -203,6 +203,11 @@ static PyObject* DBPermissionsError; /* EPERM */ staticforward PyTypeObject DB_Type, DBCursor_Type, DBEnv_Type, DBTxn_Type, DBLock_Type; +#ifndef Py_Type +/* for compatibility with Python 2.5 and earlier */ +#define Py_Type(ob) (((PyObject*)(ob))->ob_type) +#endif + #define DBObject_Check(v) (Py_Type(v) == &DB_Type) #define DBCursorObject_Check(v) (Py_Type(v) == &DBCursor_Type) #define DBEnvObject_Check(v) (Py_Type(v) == &DBEnv_Type) @@ -1849,7 +1854,9 @@ DB_open(DBObject* self, PyObject* args, PyObject* kwargs) return NULL; } +#if (DBVER >= 42) self->db->get_flags(self->db, &self->setflags); +#endif self->flags = flags; RETURN_NONE(); |