--- evdns.pxi.orig	2015-03-15 07:27:21.000000000 +1100
+++ evdns.pxi	2022-10-20 21:33:59.000000000 +1100
@@ -49,13 +49,13 @@
     if t == DNS_IPv4_A:
         x = []
         for i from 0 <= i < count:
-            x.append(PyString_FromStringAndSize(<char *>addrs + (i * 4), 4))
+            x.append(PyBytes_FromStringAndSize(<char *>addrs + (i * 4), 4))
     elif t == DNS_IPv6_AAAA:
         x = []
         for i from 0 <= i < count:
-            x.append(PyString_FromStringAndSize(<char *>addrs + (i * 16), 16))
+            x.append(PyBytes_FromStringAndSize(<char *>addrs + (i * 16), 16))
     elif t == DNS_PTR and count == 1: # only 1 PTR possible
-        x = PyString_FromString((<char **>addrs)[0])
+        x = PyBytes_FromString((<char **>addrs)[0])
     else:
         x = None
     try:
--- bufferevent.pxi.orig	2015-03-15 07:27:21.000000000 +1100
+++ bufferevent.pxi	2022-10-20 21:35:05.000000000 +1100
@@ -116,7 +116,7 @@
         else:
             size = min(self.bufev.input.off, size)
         
-        buf = PyString_FromStringAndSize(self.bufev.input.buf, size)
+        buf = PyBytes_FromStringAndSize(self.bufev.input.buf, size)
         evbuffer_drain(self.bufev.input, size)
         return buf
     
--- evhttp.pxi.orig	2015-03-15 07:27:21.000000000 +1100
+++ evhttp.pxi	2022-10-20 21:36:10.000000000 +1100
@@ -140,7 +140,7 @@
         self._buf = buf
 
     def read(self, size=-1):
-        return PyString_FromStringAndSize(EVBUFFER_DATA(self._buf),
+        return PyBytes_FromStringAndSize(EVBUFFER_DATA(self._buf),
                                           EVBUFFER_LENGTH(self._buf))
     def readline(self):
         return evbuffer_readline(self._buf) or ''
--- event.pyx.orig	2022-10-20 20:07:39.000000000 +1100
+++ event.pyx	2022-10-20 21:37:08.000000000 +1100
@@ -31,8 +31,8 @@
 cdef extern from "Python.h":
     void   Py_INCREF(object o)
     void   Py_DECREF(object o)
-    object PyString_FromStringAndSize(char *v, int len)
-    object PyString_FromString(char *v)
+    object PyBytes_FromStringAndSize(char *v, int len)
+    object PyBytes_FromString(char *v)
     int    PyObject_AsCharBuffer(object obj, char **buffer, int *buffer_len)
 
 ctypedef void (*event_handler)(int fd, short evtype, void *arg)
