diff options
Diffstat (limited to 'Python/import.c')
-rw-r--r-- | Python/import.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/Python/import.c b/Python/import.c index 5dabd9f643..31e2401fe8 100644 --- a/Python/import.c +++ b/Python/import.c @@ -1322,10 +1322,10 @@ find_module(char *fullname, char *subname, PyObject *path, char *buf, if (v == NULL) return NULL; } - if (!PyString_Check(v)) + if (!PyBytes_Check(v)) continue; - base = PyString_AS_STRING(v); - size = PyString_GET_SIZE(v); + base = PyBytes_AS_STRING(v); + size = PyBytes_GET_SIZE(v); len = size; if (len + 2 + namelen + MAXSUFFIXSIZE >= buflen) { continue; /* Too long */ @@ -2385,7 +2385,7 @@ ensure_fromlist(PyObject *mod, PyObject *fromlist, char *buf, Py_ssize_t buflen, PyErr_SetString(PyExc_ValueError, "Cannot encode path item"); return 0; } - subname = PyString_AS_STRING(item8); + subname = PyBytes_AS_STRING(item8); if (buflen + strlen(subname) >= MAXPATHLEN) { PyErr_SetString(PyExc_ValueError, "Module name too long"); @@ -2691,7 +2691,7 @@ imp_get_magic(PyObject *self, PyObject *noargs) buf[2] = (char) ((pyc_magic >> 16) & 0xff); buf[3] = (char) ((pyc_magic >> 24) & 0xff); - return PyString_FromStringAndSize(buf, 4); + return PyBytes_FromStringAndSize(buf, 4); } static PyObject * |