]> granicus.if.org Git - python/commitdiff
Handle 0-tuples which can be singletons.
authorRaymond Hettinger <python@rcn.com>
Sun, 2 Mar 2008 12:02:19 +0000 (12:02 +0000)
committerRaymond Hettinger <python@rcn.com>
Sun, 2 Mar 2008 12:02:19 +0000 (12:02 +0000)
Modules/itertoolsmodule.c

index bd5543cae77ea89b745db2ec9f9985f54aea38f4..62b2c19b904099c842965a9faf0cc84796e908cf 100644 (file)
@@ -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 */