diff options
| author | Daniele Varrazzo <daniele.varrazzo@gmail.com> | 2010-11-09 14:28:00 +0000 |
|---|---|---|
| committer | Daniele Varrazzo <daniele.varrazzo@gmail.com> | 2010-11-09 14:28:00 +0000 |
| commit | a39e98f9e51f47d7f2d7f8ccea58d0969fa33cdc (patch) | |
| tree | 4432f043c5a239d189b433923ecefd68c4ba7c84 /psycopg/microprotocols.c | |
| parent | f0773d5682882069941a139c4197d2afd0aeca21 (diff) | |
| download | psycopg2-a39e98f9e51f47d7f2d7f8ccea58d0969fa33cdc.tar.gz | |
Check the presence of a mro.
The mere presence of the Py_TPFLAGS_HAVE_CLASS doesn't ensure it is
there.
Diffstat (limited to 'psycopg/microprotocols.c')
| -rw-r--r-- | psycopg/microprotocols.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/psycopg/microprotocols.c b/psycopg/microprotocols.c index a4f3517..12ec7fb 100644 --- a/psycopg/microprotocols.c +++ b/psycopg/microprotocols.c @@ -88,7 +88,7 @@ _get_superclass_adapter(PyObject *obj, PyObject *proto) Py_ssize_t i, ii; type = (PyTypeObject *)Py_TYPE(obj); - if (!(Py_TPFLAGS_HAVE_CLASS & type->tp_flags)) { + if (!((Py_TPFLAGS_HAVE_CLASS & type->tp_flags) && type->tp_mro)) { /* has no mro */ return NULL; } |
