summaryrefslogtreecommitdiffstats
path: root/Doc/library/exceptions.rst
diff options
context:
space:
mode:
authorYury Selivanov <yselivanov@sprymix.com>2015-05-09 15:44:30 (GMT)
committerYury Selivanov <yselivanov@sprymix.com>2015-05-09 15:44:30 (GMT)
commit8170e8c0d12cb9414f3a3d3ca81a447b4afc5f26 (patch)
treed6353155110b49bf7953fd0d7d3f808512e8feb1 /Doc/library/exceptions.rst
parentbd60e8dece89440ebdc80a19b2217d5ba2515124 (diff)
downloadcpython-8170e8c0d12cb9414f3a3d3ca81a447b4afc5f26.zip
cpython-8170e8c0d12cb9414f3a3d3ca81a447b4afc5f26.tar.gz
cpython-8170e8c0d12cb9414f3a3d3ca81a447b4afc5f26.tar.bz2
PEP 479: Change StopIteration handling inside generators.
Closes issue #22906.
Diffstat (limited to 'Doc/library/exceptions.rst')
-rw-r--r--Doc/library/exceptions.rst8
1 files changed, 8 insertions, 0 deletions
diff --git a/Doc/library/exceptions.rst b/Doc/library/exceptions.rst
index bddd0ed..e7768be 100644
--- a/Doc/library/exceptions.rst
+++ b/Doc/library/exceptions.rst
@@ -310,10 +310,18 @@ The following exceptions are the exceptions that are usually raised.
raised, and the value returned by the function is used as the
:attr:`value` parameter to the constructor of the exception.
+ If a generator function defined in the presence of a ``from __future__
+ import generator_stop`` directive raises :exc:`StopIteration`, it will be
+ converted into a :exc:`RuntimeError` (retaining the :exc:`StopIteration`
+ as the new exception's cause).
+
.. versionchanged:: 3.3
Added ``value`` attribute and the ability for generator functions to
use it to return a value.
+ .. versionchanged:: 3.5
+ Introduced the RuntimeError transformation.
+
.. exception:: SyntaxError
Raised when the parser encounters a syntax error. This may occur in an