Added forgotten attributes to visit in error

This commit is contained in:
Daniele Varrazzo 2013-03-20 15:06:06 +00:00
parent 75811f5bb1
commit 9813bac4fe

View File

@ -90,6 +90,8 @@ error_init(errorObject *self, PyObject *args, PyObject *kwargs)
static int
error_traverse(errorObject *self, visitproc visit, void *arg)
{
Py_VISIT(self->pgerror);
Py_VISIT(self->pgcode);
Py_VISIT(self->cursor);
return ((PyTypeObject *)PyExc_StandardError)->tp_traverse(
(PyObject *)self, visit, arg);
@ -101,8 +103,10 @@ error_clear(errorObject *self)
Py_CLEAR(self->pgerror);
Py_CLEAR(self->pgcode);
Py_CLEAR(self->cursor);
PyMem_Free(self->codec);
CLEARPGRES(self->pgres);
return ((PyTypeObject *)PyExc_StandardError)->tp_clear((PyObject *)self);
}