Renamed PyBytes to PyByteArray
diff --git a/Modules/_sqlite/cursor.c b/Modules/_sqlite/cursor.c
index 10ce2e1..4ab8461 100644
--- a/Modules/_sqlite/cursor.c
+++ b/Modules/_sqlite/cursor.c
@@ -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);
                 }
diff --git a/Modules/_sqlite/module.c b/Modules/_sqlite/module.c
index 2284eaa..1f8c63f 100644
--- a/Modules/_sqlite/module.c
+++ b/Modules/_sqlite/module.c
@@ -137,7 +137,7 @@
     /* a basic type is adapted; there's a performance optimization if that's not the case
      * (99 % of all usages) */
     if (type == &PyLong_Type || type == &PyFloat_Type
-            || type == &PyUnicode_Type || type == &PyBytes_Type) {
+            || type == &PyUnicode_Type || type == &PyByteArray_Type) {
         pysqlite_BaseTypeAdapted = 1;
     }
 
diff --git a/Modules/_sqlite/statement.c b/Modules/_sqlite/statement.c
index ebf948b..ddbb85e 100644
--- a/Modules/_sqlite/statement.c
+++ b/Modules/_sqlite/statement.c
@@ -167,7 +167,7 @@
     }
 
     if (PyLong_CheckExact(obj) || PyFloat_CheckExact(obj)
-          || PyUnicode_CheckExact(obj) || PyBytes_CheckExact(obj)) {
+          || PyUnicode_CheckExact(obj) || PyByteArray_CheckExact(obj)) {
         return 0;
     } else {
         return 1;