Mercurial > cpython-lru_cache-weakref
diff Python/import.c @ 47301:23ab586c427a
Renamed PyString to PyBytes
| author | Christian Heimes <christian@cheimes.de> |
|---|---|
| date | Mon, 26 May 2008 13:28:38 +0000 |
| parents | ea594306ea85 |
| children | 94f64f11fdd0 |
line wrap: on
line diff
--- a/Python/import.c Mon May 26 13:22:05 2008 +0000 +++ b/Python/import.c Mon May 26 13:28:38 2008 +0000 @@ -1322,10 +1322,10 @@ 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 @@ 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 @@ 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 *
