mirror of
https://github.com/python/cpython.git
synced 2025-12-08 10:21:13 +00:00
* db->get_types is only available in BerkeleyDB >= 4.2
* get compiling with older versions of python again for a stand alone release.
This commit is contained in:
parent
ac11e02143
commit
fc006692ad
1 changed files with 7 additions and 0 deletions
|
|
@ -203,6 +203,11 @@ static PyObject* DBPermissionsError; /* EPERM */
|
||||||
|
|
||||||
staticforward PyTypeObject DB_Type, DBCursor_Type, DBEnv_Type, DBTxn_Type, DBLock_Type;
|
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 DBObject_Check(v) (Py_Type(v) == &DB_Type)
|
||||||
#define DBCursorObject_Check(v) (Py_Type(v) == &DBCursor_Type)
|
#define DBCursorObject_Check(v) (Py_Type(v) == &DBCursor_Type)
|
||||||
#define DBEnvObject_Check(v) (Py_Type(v) == &DBEnv_Type)
|
#define DBEnvObject_Check(v) (Py_Type(v) == &DBEnv_Type)
|
||||||
|
|
@ -1849,7 +1854,9 @@ DB_open(DBObject* self, PyObject* args, PyObject* kwargs)
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#if (DBVER >= 42)
|
||||||
self->db->get_flags(self->db, &self->setflags);
|
self->db->get_flags(self->db, &self->setflags);
|
||||||
|
#endif
|
||||||
|
|
||||||
self->flags = flags;
|
self->flags = flags;
|
||||||
RETURN_NONE();
|
RETURN_NONE();
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue