summaryrefslogtreecommitdiffstats
path: root/Modules
diff options
context:
space:
mode:
authorSerhiy Storchaka <storchaka@gmail.com>2019-09-09 08:18:16 (GMT)
committerGitHub <noreply@github.com>2019-09-09 08:18:16 (GMT)
commit918b468b7d5ebf1ec5e604cb0d99605cee38d983 (patch)
treec18a19721edcbb6d21ab2b98f72847ec0189db27 /Modules
parent4db25d5c39e369f4b55eab52dc8f87f390233892 (diff)
downloadcpython-918b468b7d5ebf1ec5e604cb0d99605cee38d983.zip
cpython-918b468b7d5ebf1ec5e604cb0d99605cee38d983.tar.gz
cpython-918b468b7d5ebf1ec5e604cb0d99605cee38d983.tar.bz2
Revert "Raise a RuntimeError when tee iterator is consumed from different threads (GH-15567)" (GH-15736)
This reverts commit fa220ec7633e9674baccc28dde987f29d7f65141.
Diffstat (limited to 'Modules')
-rw-r--r--Modules/itertoolsmodule.c8
1 files changed, 0 insertions, 8 deletions
diff --git a/Modules/itertoolsmodule.c b/Modules/itertoolsmodule.c
index 2e39842..cf419ad 100644
--- a/Modules/itertoolsmodule.c
+++ b/Modules/itertoolsmodule.c
@@ -452,7 +452,6 @@ typedef struct {
teedataobject *dataobj;
int index; /* 0 <= index <= LINKCELLS */
PyObject *weakreflist;
- unsigned long thread_id;
} teeobject;
static PyTypeObject teedataobject_type;
@@ -681,11 +680,6 @@ tee_next(teeobject *to)
{
PyObject *value, *link;
- if (to->thread_id != PyThread_get_thread_ident()) {
- PyErr_SetString(PyExc_RuntimeError,
- "tee() iterator can not be consumed from different threads.");
- return NULL;
- }
if (to->index >= LINKCELLS) {
link = teedataobject_jumplink(to->dataobj);
if (link == NULL)
@@ -719,7 +713,6 @@ tee_copy(teeobject *to, PyObject *Py_UNUSED(ignored))
newto->dataobj = to->dataobj;
newto->index = to->index;
newto->weakreflist = NULL;
- newto->thread_id = to->thread_id;
PyObject_GC_Track(newto);
return (PyObject *)newto;
}
@@ -752,7 +745,6 @@ tee_fromiterable(PyObject *iterable)
to->index = 0;
to->weakreflist = NULL;
- to->thread_id = PyThread_get_thread_ident();
PyObject_GC_Track(to);
done:
Py_XDECREF(it);