@@ -1138,15 +1138,15 @@ _mysql_field_to_python(
1138
1138
v = PyUnicode_Decode (rowitem , length , encoding , NULL );
1139
1139
}
1140
1140
}
1141
- else if (converter == (PyObject * )& PyBytes_Type ) {
1141
+ else if (converter == (PyObject * )& PyBytes_Type || converter == Py_None ) {
1142
1142
//fprintf(stderr, "decoding with bytes\n", encoding);
1143
1143
v = PyBytes_FromStringAndSize (rowitem , length );
1144
1144
}
1145
1145
else if (converter == (PyObject * )& PyInt_Type ) {
1146
1146
//fprintf(stderr, "decoding with int\n", encoding);
1147
1147
v = PyInt_FromString (rowitem , NULL , 10 );
1148
1148
}
1149
- else if ( converter != Py_None ) {
1149
+ else {
1150
1150
//fprintf(stderr, "decoding with callback\n");
1151
1151
//PyObject_Print(converter, stderr, 0);
1152
1152
//fprintf(stderr, "\n");
@@ -1158,17 +1158,7 @@ _mysql_field_to_python(
1158
1158
#endif
1159
1159
rowitem ,
1160
1160
(int )length );
1161
- } else {
1162
- //fprintf(stderr, "converter=None\n");
1163
- #ifdef IS_PY3K
1164
- if (!binary ) {
1165
- v = PyUnicode_FromStringAndSize (rowitem , (int )length );
1166
- } else
1167
- #endif
1168
- v = PyBytes_FromStringAndSize (rowitem , (int )length );
1169
1161
}
1170
- if (!v )
1171
- return NULL ;
1172
1162
} else {
1173
1163
Py_INCREF (Py_None );
1174
1164
v = Py_None ;
@@ -1414,7 +1404,7 @@ _mysql_ConnectionObject_change_user(
1414
1404
{
1415
1405
char * user , * pwd = NULL , * db = NULL ;
1416
1406
int r ;
1417
- static char * kwlist [] = { "user" , "passwd" , "db" , NULL } ;
1407
+ static char * kwlist [] = { "user" , "passwd" , "db" , NULL } ;
1418
1408
1419
1409
if (!PyArg_ParseTupleAndKeywords (args , kwargs , "s|ss:change_user" ,
1420
1410
kwlist , & user , & pwd , & db ))
@@ -1424,8 +1414,7 @@ _mysql_ConnectionObject_change_user(
1424
1414
r = mysql_change_user (& (self -> connection ), user , pwd , db );
1425
1415
Py_END_ALLOW_THREADS
1426
1416
if (r ) return _mysql_Exception (self );
1427
- Py_INCREF (Py_None );
1428
- return Py_None ;
1417
+ Py_RETURN_NONE ;
1429
1418
}
1430
1419
1431
1420
static char _mysql_ConnectionObject_character_set_name__doc__ [] =
0 commit comments