diff Python/bltinmodule.c @ 53956:72a50394c2dd legacy-trunk

don't ignore exceptions from _PyObject_LengthHint
author Benjamin Peterson <benjamin@python.org>
date Sat, 09 May 2009 19:17:59 +0000
parents 93223603c992
children 821f7d42bf74
line wrap: on
line diff
--- a/Python/bltinmodule.c	Sat May 09 19:03:05 2009 +0000
+++ b/Python/bltinmodule.c	Sat May 09 19:17:59 2009 +0000
@@ -2383,8 +2383,10 @@
 	len = -1;	/* unknown */
 	for (i = 0; i < itemsize; ++i) {
 		PyObject *item = PyTuple_GET_ITEM(args, i);
-		Py_ssize_t thislen = _PyObject_LengthHint(item, -1);
+		Py_ssize_t thislen = _PyObject_LengthHint(item, -2);
 		if (thislen < 0) {
+			if (thislen == -1)
+				return NULL;
 			len = -1;
 			break;
 		}