diff Objects/typeobject.c @ 51478:da0070cf4654 3.0

Merged revisions 69451 via svnmerge from svn+ssh://pythondev@svn.python.org/python/branches/py3k ........ r69451 | benjamin.peterson | 2009-02-08 15:07:20 -0600 (Sun, 08 Feb 2009) | 1 line fix len() when __len__() returns a non number type #5137 ........
author Benjamin Peterson <benjamin@python.org>
date Sun, 08 Feb 2009 21:16:01 +0000
parents 7bfa64492d00
children c6688e9156b5
line wrap: on
line diff
--- a/Objects/typeobject.c	Sun Feb 08 15:11:29 2009 +0000
+++ b/Objects/typeobject.c	Sun Feb 08 21:16:01 2009 +0000
@@ -4618,7 +4618,7 @@
 
 	if (res == NULL)
 		return -1;
-	len = PyLong_AsSsize_t(res);
+	len = PyNumber_AsSsize_t(res, PyExc_OverflowError);
 	Py_DECREF(res);
 	if (len < 0) {
 		if (!PyErr_Occurred())