mirror of
https://github.com/python/cpython.git
synced 2025-08-27 20:25:18 +00:00
Change int to Py_ssize_t in several places.
Add (int) casts to silence compiler warnings. Raise Python exceptions for overflows.
This commit is contained in:
parent
8eb8a829c1
commit
725507b52e
11 changed files with 57 additions and 32 deletions
|
@ -764,7 +764,7 @@ static PyObject *
|
|||
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 @@ SyntaxError__str__(PyObject *self, PyObject *args)
|
|||
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);
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue