Mercurial > cpython-lru_cache-weakref
diff Modules/_sqlite/cursor.c @ 47300:96b34263e448
Renamed PyBytes to PyByteArray
| author | Christian Heimes <christian@cheimes.de> |
|---|---|
| date | Mon, 26 May 2008 13:22:05 +0000 |
| parents | 031dfe455585 |
| children | 23ab586c427a |
line wrap: on
line diff
--- a/Modules/_sqlite/cursor.c Mon May 26 13:16:12 2008 +0000 +++ b/Modules/_sqlite/cursor.c Mon May 26 13:22:05 2008 +0000 @@ -352,7 +352,7 @@ } PyOS_snprintf(buf, sizeof(buf) - 1, "Could not decode to UTF-8 column '%s' with text '%s'", colname , val_str); - buf_bytes = PyBytes_FromStringAndSize(buf, strlen(buf)); + buf_bytes = PyByteArray_FromStringAndSize(buf, strlen(buf)); if (!buf_bytes) { PyErr_SetString(pysqlite_OperationalError, "Could not decode to UTF-8"); } else { @@ -368,8 +368,8 @@ } } else if (self->connection->text_factory == (PyObject*)&PyString_Type) { converted = PyString_FromString(val_str); - } else if (self->connection->text_factory == (PyObject*)&PyBytes_Type) { - converted = PyBytes_FromStringAndSize(val_str, strlen(val_str)); + } else if (self->connection->text_factory == (PyObject*)&PyByteArray_Type) { + converted = PyByteArray_FromStringAndSize(val_str, strlen(val_str)); } else { converted = PyObject_CallFunction(self->connection->text_factory, "y", val_str); }
