From: Raymond Hettinger Date: Sun, 2 Mar 2008 12:02:19 +0000 (+0000) Subject: Handle 0-tuples which can be singletons. X-Git-Tag: v2.6a2~429 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=e3fabd10cb898a93cf32d743d44ca85290b78f07;p=thirdparty%2FPython%2Fcpython.git Handle 0-tuples which can be singletons. --- diff --git a/Modules/itertoolsmodule.c b/Modules/itertoolsmodule.c index bd5543cae77e..62b2c19b9040 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 */