Mercurial > cpython-lru_cache-weakref
diff Python/exceptions.c @ 36866:9eb24f92a784 legacy-trunk
Change int to Py_ssize_t in several places.
Add (int) casts to silence compiler warnings.
Raise Python exceptions for overflows.
| author | Martin v. Löwis <martin@v.loewis.de> |
|---|---|
| date | Tue, 07 Mar 2006 12:08:51 +0000 |
| parents | d02b4cfefa0a |
| children | f731859e9b3b 2b2e9c388fbb |
line wrap: on
line diff
--- a/Python/exceptions.c Tue Mar 07 11:58:50 2006 +0000 +++ b/Python/exceptions.c Tue Mar 07 12:08:51 2006 +0000 @@ -764,7 +764,7 @@ SyntaxError__init__(PyObject *self, PyObject *args) { PyObject *rtnval = NULL; - int lenargs; + Py_ssize_t lenargs; if (!(self = get_self(args))) return NULL; @@ -889,7 +889,7 @@ PyErr_Clear(); if (have_filename || have_lineno) { - int bufsize = PyString_GET_SIZE(str) + 64; + Py_ssize_t bufsize = PyString_GET_SIZE(str) + 64; if (have_filename) bufsize += PyString_GET_SIZE(filename);
