summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGeorg Brandl <georg@python.org>2006-08-08 11:56:21 +0000
committerGeorg Brandl <georg@python.org>2006-08-08 11:56:21 +0000
commitb0061c8e93aadc0d7e0c07734e04f056a8bcb8bb (patch)
treea610ee0f9a065a56b6f6a8cc8891eb468016d170
parentf3321b5e76e47286899265f3be103f958b22b912 (diff)
downloadcpython-git-b0061c8e93aadc0d7e0c07734e04f056a8bcb8bb.tar.gz
Remove "non-mapping" and "non-sequence" from TypeErrors raised by
PyMapping_Size and PySequence_Size. Because len() tries first sequence, then mapping size, it will always raise a "non-mapping object has no len" error which is confusing.
-rw-r--r--Objects/abstract.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/Objects/abstract.c b/Objects/abstract.c
index 638e41787d..bad9f96541 100644
--- a/Objects/abstract.c
+++ b/Objects/abstract.c
@@ -1114,7 +1114,7 @@ PySequence_Size(PyObject *s)
if (m && m->sq_length)
return m->sq_length(s);
- type_error("non-sequence object of type '%.200s' has no len()", s);
+ type_error("object of type '%.200s' has no len()", s);
return -1;
}
@@ -1705,7 +1705,7 @@ PyMapping_Size(PyObject *o)
if (m && m->mp_length)
return m->mp_length(o);
- type_error("non-mapping object of type '%.200s' has no len()", o);
+ type_error("object of type '%.200s' has no len()", o);
return -1;
}