Mercurial > cpython-lru_cache-weakref
diff Modules/_struct.c @ 47300:96b34263e448
Renamed PyBytes to PyByteArray
| author | Christian Heimes <christian@cheimes.de> |
|---|---|
| date | Mon, 26 May 2008 13:22:05 +0000 |
| parents | 832c820e9d14 |
| children | 23ab586c427a |
line wrap: on
line diff
--- a/Modules/_struct.c Mon May 26 13:16:12 2008 +0000 +++ b/Modules/_struct.c Mon May 26 13:22:05 2008 +0000 @@ -1646,7 +1646,7 @@ return -1; } isstring = PyString_Check(v); - if (!isstring && !PyBytes_Check(v)) { + if (!isstring && !PyByteArray_Check(v)) { PyErr_SetString(StructError, "argument for 's' must be a string"); return -1; @@ -1656,8 +1656,8 @@ p = PyString_AS_STRING(v); } else { - n = PyBytes_GET_SIZE(v); - p = PyBytes_AS_STRING(v); + n = PyByteArray_GET_SIZE(v); + p = PyByteArray_AS_STRING(v); } if (n > code->size) n = code->size; @@ -1672,7 +1672,7 @@ return -1; } isstring = PyString_Check(v); - if (!isstring && !PyBytes_Check(v)) { + if (!isstring && !PyByteArray_Check(v)) { PyErr_SetString(StructError, "argument for 'p' must be a string"); return -1; @@ -1682,8 +1682,8 @@ p = PyString_AS_STRING(v); } else { - n = PyBytes_GET_SIZE(v); - p = PyBytes_AS_STRING(v); + n = PyByteArray_GET_SIZE(v); + p = PyByteArray_AS_STRING(v); } if (n > (code->size - 1)) n = code->size - 1;
