diff options
Diffstat (limited to 'Python')
-rw-r--r-- | Python/bltinmodule.c | 18 |
1 files changed, 3 insertions, 15 deletions
diff --git a/Python/bltinmodule.c b/Python/bltinmodule.c index 6ca2a28..200ec26 100644 --- a/Python/bltinmodule.c +++ b/Python/bltinmodule.c @@ -1855,22 +1855,10 @@ is a shortcut for issubclass(X, A) or issubclass(X, B) or ... (etc.)."); static PyObject* builtin_zip(PyObject *self, PyObject *args) { - PyObject *itertools = NULL, *izip = NULL, *result = NULL; + /* args must be a tuple */ + assert(PyTuple_Check(args)); - itertools = PyImport_ImportModule("itertools"); - if (itertools == NULL) - return NULL; - - izip = PyObject_GetAttrString(itertools, "izip"); - if (izip == NULL) - goto done; - - result = PyObject_Call(izip, args, NULL); - - done: - Py_XDECREF(itertools); - Py_XDECREF(izip); - return result; + return _PyZip_CreateIter(args); } |