File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -67,7 +67,7 @@ PyObject* pysqlite_row_subscript(pysqlite_Row* self, PyObject* idx)
6767{
6868 long _idx ;
6969 char * key ;
70- int nitems , i ;
70+ Py_ssize_t nitems , i ;
7171 char * compare_key ;
7272
7373 char * p1 ;
@@ -88,7 +88,10 @@ PyObject* pysqlite_row_subscript(pysqlite_Row* self, PyObject* idx)
8888 nitems = PyTuple_Size (self -> description );
8989
9090 for (i = 0 ; i < nitems ; i ++ ) {
91- compare_key = _PyUnicode_AsString (PyTuple_GET_ITEM (PyTuple_GET_ITEM (self -> description , i ), 0 ));
91+ PyObject * obj ;
92+ obj = PyTuple_GET_ITEM (self -> description , i );
93+ obj = PyTuple_GET_ITEM (obj , 0 );
94+ compare_key = _PyUnicode_AsString (obj );
9295 if (!compare_key ) {
9396 return NULL ;
9497 }
@@ -120,10 +123,12 @@ PyObject* pysqlite_row_subscript(pysqlite_Row* self, PyObject* idx)
120123
121124 PyErr_SetString (PyExc_IndexError , "No item with that key" );
122125 return NULL ;
123- } else if (PySlice_Check (idx )) {
126+ }
127+ else if (PySlice_Check (idx )) {
124128 PyErr_SetString (PyExc_ValueError , "slices not implemented, yet" );
125129 return NULL ;
126- } else {
130+ }
131+ else {
127132 PyErr_SetString (PyExc_IndexError , "Index must be int or string" );
128133 return NULL ;
129134 }
You can’t perform that action at this time.
0 commit comments