mirror of
https://github.com/psycopg/psycopg2.git
synced 2025-02-17 01:20:32 +03:00
register_type() now works on connection and cursor subclasses
This commit is contained in:
parent
78c0765367
commit
e22451736a
|
@ -1,3 +1,9 @@
|
|||
2009-01-20 Federico Di Gregorio <fog@initd.org
|
||||
|
||||
* Fixed problem reported by Lawrence Oluyede where
|
||||
register_type() didn't work on connection and cursors
|
||||
suclasses.
|
||||
|
||||
2009-01-10 Federico Di Gregorio <fog@initd.org>
|
||||
|
||||
* psycopg/cursor_type.c: cursor.isready() now raise an exception
|
||||
|
|
|
@ -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 {
|
||||
|
|
Loading…
Reference in New Issue
Block a user