3232
3333
3434PyObject *
35- error_text_from_chars (PsycoErrorObject * self , const char * str )
35+ error_text_from_chars (errorObject * self , const char * str )
3636{
3737 if (str == NULL ) {
3838 Py_INCREF (Py_None );
@@ -61,11 +61,11 @@ static const char diag_doc[] =
6161 "A Diagnostics object to get further information about the error" ;
6262
6363static PyMemberDef error_members [] = {
64- { "pgerror" , T_OBJECT , offsetof(PsycoErrorObject , pgerror ),
64+ { "pgerror" , T_OBJECT , offsetof(errorObject , pgerror ),
6565 READONLY , (char * )pgerror_doc },
66- { "pgcode" , T_OBJECT , offsetof(PsycoErrorObject , pgcode ),
66+ { "pgcode" , T_OBJECT , offsetof(errorObject , pgcode ),
6767 READONLY , (char * )pgcode_doc },
68- { "cursor" , T_OBJECT , offsetof(PsycoErrorObject , cursor ),
68+ { "cursor" , T_OBJECT , offsetof(errorObject , cursor ),
6969 READONLY , (char * )cursor_doc },
7070 { NULL }
7171};
@@ -78,7 +78,7 @@ error_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
7878}
7979
8080static int
81- error_init (PsycoErrorObject * self , PyObject * args , PyObject * kwargs )
81+ error_init (errorObject * self , PyObject * args , PyObject * kwargs )
8282{
8383 if (((PyTypeObject * )PyExc_StandardError )-> tp_init (
8484 (PyObject * )self , args , kwargs ) < 0 ) {
@@ -88,15 +88,15 @@ error_init(PsycoErrorObject *self, PyObject *args, PyObject *kwargs)
8888}
8989
9090static int
91- error_traverse (PsycoErrorObject * self , visitproc visit , void * arg )
91+ error_traverse (errorObject * self , visitproc visit , void * arg )
9292{
9393 Py_VISIT (self -> cursor );
9494 return ((PyTypeObject * )PyExc_StandardError )-> tp_traverse (
9595 (PyObject * )self , visit , arg );
9696}
9797
9898static int
99- error_clear (PsycoErrorObject * self )
99+ error_clear (errorObject * self )
100100{
101101 Py_CLEAR (self -> pgerror );
102102 Py_CLEAR (self -> pgcode );
@@ -107,15 +107,15 @@ error_clear(PsycoErrorObject *self)
107107}
108108
109109static void
110- error_dealloc (PsycoErrorObject * self )
110+ error_dealloc (errorObject * self )
111111{
112112 error_clear (self );
113113 return Py_TYPE (self )-> tp_free ((PyObject * )self );
114114}
115115
116116
117117static PyObject *
118- error_get_diag (PsycoErrorObject * self , void * closure )
118+ error_get_diag (errorObject * self , void * closure )
119119{
120120 return PyObject_CallFunctionObjArgs (
121121 (PyObject * )& diagnosticsType , (PyObject * )self , NULL );
@@ -136,7 +136,7 @@ static struct PyGetSetDef error_getsets[] = {
136136 * would require implementing __getstate__, and as of 2012 it's a little
137137 * bit too late to care. */
138138static PyObject *
139- psyco_error_reduce (PsycoErrorObject * self )
139+ psyco_error_reduce (errorObject * self )
140140{
141141 PyObject * meth = NULL ;
142142 PyObject * tuple = NULL ;
@@ -187,7 +187,7 @@ psyco_error_reduce(PsycoErrorObject *self)
187187}
188188
189189PyObject *
190- psyco_error_setstate (PsycoErrorObject * self , PyObject * state )
190+ psyco_error_setstate (errorObject * self , PyObject * state )
191191{
192192 PyObject * rv = NULL ;
193193
@@ -242,10 +242,10 @@ static PyMethodDef error_methods[] = {
242242};
243243
244244
245- PyTypeObject ErrorType = {
245+ PyTypeObject errorType = {
246246 PyVarObject_HEAD_INIT (NULL , 0 )
247247 "psycopg2.Error" ,
248- sizeof (PsycoErrorObject ),
248+ sizeof (errorObject ),
249249 0 ,
250250 (destructor )error_dealloc , /* tp_dealloc */
251251 0 , /*tp_print*/
0 commit comments