summaryrefslogtreecommitdiff
path: root/psycopg/psycopgmodule.c
diff options
context:
space:
mode:
Diffstat (limited to 'psycopg/psycopgmodule.c')
-rw-r--r--psycopg/psycopgmodule.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/psycopg/psycopgmodule.c b/psycopg/psycopgmodule.c
index 43e0402..eb05b84 100644
--- a/psycopg/psycopgmodule.c
+++ b/psycopg/psycopgmodule.c
@@ -243,10 +243,10 @@ psyco_register_type(PyObject *self, PyObject *args)
}
if (obj != NULL) {
- if (obj->ob_type == &cursorType) {
+ if (PyObject_TypeCheck(obj, &cursorType)) {
_psyco_register_type_set(&(((cursorObject*)obj)->string_types), type);
}
- else if (obj->ob_type == &connectionType) {
+ else if (PyObject_TypeCheck(obj, &connectionType)) {
typecast_add(type, ((connectionObject*)obj)->string_types, 0);
}
else {