summaryrefslogtreecommitdiffstats
path: root/Python
diff options
context:
space:
mode:
authorJeremy Hylton <jeremy@alum.mit.edu>2000-07-12 13:05:33 (GMT)
committerJeremy Hylton <jeremy@alum.mit.edu>2000-07-12 13:05:33 (GMT)
commit03657cfdb056dbd36db12cc3db12a6b58a962e20 (patch)
tree18dc8d472d1eba419c8d2a31847de5607f805a66 /Python
parent6253f83b0a2d261024cd5ef84d2e36fe4f4f1f3d (diff)
downloadcpython-03657cfdb056dbd36db12cc3db12a6b58a962e20.zip
cpython-03657cfdb056dbd36db12cc3db12a6b58a962e20.tar.gz
cpython-03657cfdb056dbd36db12cc3db12a6b58a962e20.tar.bz2
replace PyXXX_Length calls with PyXXX_Size calls
Diffstat (limited to 'Python')
-rw-r--r--Python/bltinmodule.c2
-rw-r--r--Python/exceptions.c17
-rw-r--r--Python/getargs.c2
3 files changed, 11 insertions, 10 deletions
diff --git a/Python/bltinmodule.c b/Python/bltinmodule.c
index a00cd5d..0746282 100644
--- a/Python/bltinmodule.c
+++ b/Python/bltinmodule.c
@@ -1385,7 +1385,7 @@ builtin_len(self, args)
if (!PyArg_ParseTuple(args, "O:len", &v))
return NULL;
- res = PyObject_Length(v);
+ res = PyObject_Size(v);
if (res < 0 && PyErr_Occurred())
return NULL;
return PyInt_FromLong(res);
diff --git a/Python/exceptions.c b/Python/exceptions.c
index c0e4d54..05e318e 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;
diff --git a/Python/getargs.c b/Python/getargs.c
index ba855af..11754ef 100644
--- a/Python/getargs.c
+++ b/Python/getargs.c
@@ -348,7 +348,7 @@ converttuple(arg, p_format, p_va, levels, msgbuf, toplevel)
return msgbuf;
}
- if ((i = PySequence_Length(arg)) != n) {
+ if ((i = PySequence_Size(arg)) != n) {
levels[0] = 0;
sprintf(msgbuf,
toplevel ? "%d arguments, %d" : "%d-sequence, %d-sequence",