diff --git a/Python/import.c b/Python/import.c index 5b96cea5459..8b11aadf6f7 100644 --- a/Python/import.c +++ b/Python/import.c @@ -2686,7 +2686,7 @@ imp_get_magic(PyObject *self, PyObject *noargs) buf[2] = (char) ((pyc_magic >> 16) & 0xff); buf[3] = (char) ((pyc_magic >> 24) & 0xff); - return PyBytes_FromStringAndSize(buf, 4); + return PyString_FromStringAndSize(buf, 4); } static PyObject *