summaryrefslogtreecommitdiffstats
path: root/Modules/itertoolsmodule.c
diff options
context:
space:
mode:
authorChristian Heimes <christian@cheimes.de>2008-03-04 23:39:23 (GMT)
committerChristian Heimes <christian@cheimes.de>2008-03-04 23:39:23 (GMT)
commit7864476afa402a0537c33ba9630e77351720baf8 (patch)
treecb9113e14d6a0b56696398f4d61d107ea7055e08 /Modules/itertoolsmodule.c
parent227c800f4397764a20b77fd58467e2bb27fbf510 (diff)
downloadcpython-7864476afa402a0537c33ba9630e77351720baf8.zip
cpython-7864476afa402a0537c33ba9630e77351720baf8.tar.gz
cpython-7864476afa402a0537c33ba9630e77351720baf8.tar.bz2
Merged revisions 61209-61214,61217-61222,61224-61226,61233-61237 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/trunk ........ r61209 | georg.brandl | 2008-03-03 21:37:55 +0100 (Mon, 03 Mar 2008) | 2 lines There are now sixteen isfoo functions. ........ r61210 | georg.brandl | 2008-03-03 21:39:00 +0100 (Mon, 03 Mar 2008) | 2 lines 15 -> 16, the 2nd ........ r61211 | georg.brandl | 2008-03-03 22:22:47 +0100 (Mon, 03 Mar 2008) | 2 lines Actually import itertools. ........ r61212 | georg.brandl | 2008-03-03 22:31:50 +0100 (Mon, 03 Mar 2008) | 2 lines Expand a bit on genexp scopes. ........ r61213 | raymond.hettinger | 2008-03-03 23:04:55 +0100 (Mon, 03 Mar 2008) | 1 line Remove dependency on itertools -- a simple genexp suffices. ........ r61214 | raymond.hettinger | 2008-03-03 23:19:58 +0100 (Mon, 03 Mar 2008) | 1 line Issue 2226: Callable checked for the wrong abstract method. ........ r61217 | andrew.kuchling | 2008-03-04 01:40:32 +0100 (Tue, 04 Mar 2008) | 1 line Typo fix ........ r61218 | andrew.kuchling | 2008-03-04 02:30:10 +0100 (Tue, 04 Mar 2008) | 1 line Grammar fix; markup fix ........ r61219 | andrew.kuchling | 2008-03-04 02:47:38 +0100 (Tue, 04 Mar 2008) | 1 line Fix sentence fragment ........ r61220 | andrew.kuchling | 2008-03-04 02:48:26 +0100 (Tue, 04 Mar 2008) | 1 line Typo fix ........ r61221 | andrew.kuchling | 2008-03-04 02:49:37 +0100 (Tue, 04 Mar 2008) | 1 line Add versionadded tags ........ r61222 | andrew.kuchling | 2008-03-04 02:50:32 +0100 (Tue, 04 Mar 2008) | 1 line Thesis night results: add various items ........ r61224 | raymond.hettinger | 2008-03-04 05:17:08 +0100 (Tue, 04 Mar 2008) | 1 line Beef-up docs and tests for itertools. Fix-up end-case for product(). ........ r61225 | georg.brandl | 2008-03-04 08:25:54 +0100 (Tue, 04 Mar 2008) | 2 lines Fix some patch attributions. ........ r61226 | georg.brandl | 2008-03-04 08:33:30 +0100 (Tue, 04 Mar 2008) | 2 lines #2230: document that PyArg_* leaves addresses alone on error. ........ r61233 | neal.norwitz | 2008-03-04 17:22:46 +0100 (Tue, 04 Mar 2008) | 3 lines Close the file before trying to remove the directory so it works on Windows. As reported by Trent Nelson on python-dev. ........ r61234 | thomas.heller | 2008-03-04 21:09:11 +0100 (Tue, 04 Mar 2008) | 9 lines Merged changes from libffi3-branch. The bundled libffi copy is now in sync with the recently released libffi3.0.4 version, apart from some small changes to Modules/_ctypes/libffi/configure.ac. I gave up on using libffi3 files on os x. Instead, static configuration with files from pyobjc is used. ........ r61235 | thomas.heller | 2008-03-04 21:21:42 +0100 (Tue, 04 Mar 2008) | 1 line Try to fix the build for PY_LINUX. ........ r61236 | fred.drake | 2008-03-04 22:14:04 +0100 (Tue, 04 Mar 2008) | 2 lines fix typo ........ r61237 | raymond.hettinger | 2008-03-04 23:29:44 +0100 (Tue, 04 Mar 2008) | 1 line Fix refleak in chain(). ........
Diffstat (limited to 'Modules/itertoolsmodule.c')
-rw-r--r--Modules/itertoolsmodule.c7
1 files changed, 2 insertions, 5 deletions
diff --git a/Modules/itertoolsmodule.c b/Modules/itertoolsmodule.c
index 994b452..c0de36d 100644
--- a/Modules/itertoolsmodule.c
+++ b/Modules/itertoolsmodule.c
@@ -1652,8 +1652,8 @@ chain_next(chainobject *lz)
return NULL; /* no more input sources */
}
lz->active = PyObject_GetIter(iterable);
+ Py_DECREF(iterable);
if (lz->active == NULL) {
- Py_DECREF(iterable);
Py_CLEAR(lz->source);
return NULL; /* input not iterable */
}
@@ -1855,10 +1855,7 @@ product_next(productobject *lz)
if (result == NULL) {
/* On the first pass, return an initial tuple filled with the
- first element from each pool. If any pool is empty, then
- whole product is empty and we're already done */
- if (npools == 0)
- goto empty;
+ first element from each pool. */
result = PyTuple_New(npools);
if (result == NULL)
goto empty;