Re: (Real)DictConnection is not compatible with the adaptation mechanism
Lawrence Oluyede <[email protected]>
| Newsgroups | gmane.comp.python.db.psycopg.devel |
|---|---|
| Message-ID | <[email protected]> |
On Wed, Jan 21, 2009 at 9:42 PM, James Henstridge <[email protected]> wrote: >> 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)) { > You could try replacing the type checks with e.g. > > PyObject_TypeCheck(obj, &cursorType) > > That should handle the subclassed connection correctly. If you try > this, please tell us whether it is successful or not so we can fix it > in future versions. Great! It works! I tried to run all the tests and nothing broke. Is there any specific test I should be wary of? -- Lawrence, http://oluyede.org - http://twitter.com/lawrenceoluyede "It is difficult to get a man to understand something when his salary depends on not understanding it" - Upton Sinclair