@@ -103,10 +103,6 @@ list_prepare(listObject *self, PyObject *args)
103
103
if (!PyArg_ParseTuple (args , "O!" , & connectionType , & conn ))
104
104
return NULL ;
105
105
106
- /* note that we don't copy the encoding from the connection, but take a
107
- reference to it; we'll need it during the recursive adapt() call (the
108
- encoding is here for a future expansion that will make .getquoted()
109
- work even without a connection to the backend. */
110
106
Py_CLEAR (self -> connection );
111
107
Py_INCREF (conn );
112
108
self -> connection = conn ;
@@ -154,7 +150,7 @@ static PyMethodDef listObject_methods[] = {
154
150
/* initialization and finalization methods */
155
151
156
152
static int
157
- list_setup (listObject * self , PyObject * obj , const char * enc )
153
+ list_setup (listObject * self , PyObject * obj )
158
154
{
159
155
Dprintf ("list_setup: init list object at %p, refcnt = "
160
156
FORMAT_CODE_PY_SSIZE_T ,
@@ -164,9 +160,6 @@ list_setup(listObject *self, PyObject *obj, const char *enc)
164
160
if (!PyList_Check (obj ))
165
161
return -1 ;
166
162
167
- /* FIXME: remove this orrible strdup */
168
- if (enc ) self -> encoding = strdup (enc );
169
-
170
163
self -> connection = NULL ;
171
164
Py_INCREF (obj );
172
165
self -> wrapped = obj ;
@@ -195,7 +188,6 @@ list_dealloc(PyObject* obj)
195
188
196
189
Py_CLEAR (self -> wrapped );
197
190
Py_CLEAR (self -> connection );
198
- if (self -> encoding ) free (self -> encoding );
199
191
200
192
Dprintf ("list_dealloc: deleted list object at %p, "
201
193
"refcnt = " FORMAT_CODE_PY_SSIZE_T , obj , Py_REFCNT (obj ));
@@ -207,12 +199,11 @@ static int
207
199
list_init (PyObject * obj , PyObject * args , PyObject * kwds )
208
200
{
209
201
PyObject * l ;
210
- const char * enc = "latin-1" ; /* default encoding as in Python */
211
202
212
- if (!PyArg_ParseTuple (args , "O|s " , & l , & enc ))
203
+ if (!PyArg_ParseTuple (args , "O" , & l ))
213
204
return -1 ;
214
205
215
- return list_setup ((listObject * )obj , l , enc );
206
+ return list_setup ((listObject * )obj , l );
216
207
}
217
208
218
209
static PyObject *
@@ -279,10 +270,9 @@ PyObject *
279
270
psyco_List (PyObject * module , PyObject * args )
280
271
{
281
272
PyObject * str ;
282
- const char * enc = "latin-1" ; /* default encoding as in Python */
283
273
284
- if (!PyArg_ParseTuple (args , "O|s " , & str , & enc ))
274
+ if (!PyArg_ParseTuple (args , "O" , & str ))
285
275
return NULL ;
286
276
287
- return PyObject_CallFunction ((PyObject * )& listType , "Os " , str , enc );
277
+ return PyObject_CallFunctionObjArgs ((PyObject * )& listType , "O " , str , NULL );
288
278
}
0 commit comments