From 245f025ea94faed3a5df906f448a7a16bfd38a96 Mon Sep 17 00:00:00 2001 From: Jeremy Hylton Date: Wed, 12 Jul 2000 13:05:33 +0000 Subject: replace PyXXX_Length calls with PyXXX_Size calls --- Python/exceptions.c | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) (limited to 'Python/exceptions.c') diff --git a/Python/exceptions.c b/Python/exceptions.c index c0e4d5464b..05e318e453 100644 --- a/Python/exceptions.c +++ b/Python/exceptions.c @@ -224,7 +224,8 @@ Exception__init__(PyObject* self, PyObject* args) return NULL; /* set args attribute */ - args = PySequence_GetSlice(args, 1, PySequence_Length(args)); + /* XXX size is only a hint */ + args = PySequence_GetSlice(args, 1, PySequence_Size(args)); if (!args) return NULL; status = PyObject_SetAttrString(self, "args", args); @@ -249,7 +250,7 @@ Exception__str__(PyObject* self, PyObject* args) if (!args) return NULL; - switch (PySequence_Length(args)) { + switch (PySequence_Size(args)) { case 0: out = PyString_FromString(""); break; @@ -374,7 +375,7 @@ SystemExit__init__(PyObject* self, PyObject* args) return NULL; /* Set args attribute. */ - if (!(args = PySequence_GetSlice(args, 1, PySequence_Length(args)))) + if (!(args = PySequence_GetSlice(args, 1, PySequence_Size(args)))) return NULL; status = PyObject_SetAttrString(self, "args", args); @@ -384,7 +385,7 @@ SystemExit__init__(PyObject* self, PyObject* args) } /* set code attribute */ - switch (PySequence_Length(args)) { + switch (PySequence_Size(args)) { case 0: Py_INCREF(Py_None); code = Py_None; @@ -441,7 +442,7 @@ EnvironmentError__init__(PyObject* self, PyObject* args) if (!(self = get_self(args))) return NULL; - if (!(args = PySequence_GetSlice(args, 1, PySequence_Length(args)))) + if (!(args = PySequence_GetSlice(args, 1, PySequence_Size(args)))) return NULL; if (PyObject_SetAttrString(self, "args", args) || @@ -452,7 +453,7 @@ EnvironmentError__init__(PyObject* self, PyObject* args) goto finally; } - switch (PySequence_Length(args)) { + switch (PySequence_Size(args)) { case 3: /* Where a function has a single filename, such as open() or some * of the os module functions, PyErr_SetFromErrnoWithFilename() is @@ -671,13 +672,13 @@ SyntaxError__init__(PyObject* self, PyObject* args) if (!(self = get_self(args))) return NULL; - if (!(args = PySequence_GetSlice(args, 1, PySequence_Length(args)))) + if (!(args = PySequence_GetSlice(args, 1, PySequence_Size(args)))) return NULL; if (PyObject_SetAttrString(self, "args", args)) goto finally; - lenargs = PySequence_Length(args); + lenargs = PySequence_Size(args); if (lenargs >= 1) { PyObject* item0 = PySequence_GetItem(args, 0); int status; -- cgit v1.2.1