diff Python/bltinmodule.c @ 51282:ca71a44d5432 2.6

Issue 1242657: list(obj) can swallow KeyboardInterrupt
author Raymond Hettinger <python@rcn.com>
date Mon, 02 Feb 2009 22:44:06 +0000
parents 5508862a1de5
children f65d62473465 75efd757434b
line wrap: on
line diff
--- a/Python/bltinmodule.c	Mon Feb 02 21:15:41 2009 +0000
+++ b/Python/bltinmodule.c	Mon Feb 02 22:44:06 2009 +0000
@@ -268,6 +268,8 @@
 
 	/* Guess a result list size. */
 	len = _PyObject_LengthHint(seq, 8);
+	if (len == -1)
+		goto Fail_it;
 
 	/* Get a result list. */
 	if (PyList_Check(seq) && seq->ob_refcnt == 1) {