From 3631a1075df038ca101cc353db4e75c039705646 Mon Sep 17 00:00:00 2001 From: "raymond.hettinger" Date: Sun, 2 Mar 2008 12:02:19 +0000 Subject: [PATCH] Handle 0-tuples which can be singletons. git-svn-id: http://svn.python.org/projects/python/trunk@61173 6015fed2-1504-0410-9fe1-9d1591cc4771 --- Modules/itertoolsmodule.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Modules/itertoolsmodule.c b/Modules/itertoolsmodule.c index bd5543cae7..62b2c19b90 100644 --- a/Modules/itertoolsmodule.c +++ b/Modules/itertoolsmodule.c @@ -1919,7 +1919,7 @@ product_next(productobject *lz) Py_DECREF(old_result); } /* Now, we've got the only copy so we can update it in-place */ - assert (Py_REFCNT(result) == 1); + assert (npools==0 || Py_REFCNT(result) == 1); /* Update the pool indices right-to-left. Only advance to the next pool when the previous one rolls-over */ -- 2.11.4.GIT