bpo-34410: Fix a crash in the tee iterator when re-enter it. (GH-15625)
RuntimeError is now raised in this case.
diff --git a/Doc/library/itertools.rst b/Doc/library/itertools.rst
index a3f403a..8d134d4 100644
--- a/Doc/library/itertools.rst
+++ b/Doc/library/itertools.rst
@@ -645,6 +645,10 @@
used anywhere else; otherwise, the *iterable* could get advanced without
the tee objects being informed.
+ ``tee`` iterators are not threadsafe. A :exc:`RuntimeError` may be
+ raised when using simultaneously iterators returned by the same :func:`tee`
+ call, even if the original *iterable* is threadsafe.
+
This itertool may require significant auxiliary storage (depending on how
much temporary data needs to be stored). In general, if one iterator uses
most or all of the data before another iterator starts, it is faster to use