summaryrefslogtreecommitdiffstats
path: root/Doc/library/exceptions.rst
diff options
context:
space:
mode:
authorYury Selivanov <yury@magic.io>2018-01-26 20:24:24 (GMT)
committerGitHub <noreply@github.com>2018-01-26 20:24:24 (GMT)
commit43c47fe09640c579462978ec16f81295f5857cde (patch)
tree6a1524a805eb5d181acc04552bfb1a09ea736e39 /Doc/library/exceptions.rst
parentdba976b8a28d6e5daa66ef31a6a7c694a9193f6a (diff)
downloadcpython-43c47fe09640c579462978ec16f81295f5857cde.zip
cpython-43c47fe09640c579462978ec16f81295f5857cde.tar.gz
cpython-43c47fe09640c579462978ec16f81295f5857cde.tar.bz2
bpo-32670: Enforce PEP 479. (#5327)
Diffstat (limited to 'Doc/library/exceptions.rst')
-rw-r--r--Doc/library/exceptions.rst14
1 files changed, 9 insertions, 5 deletions
diff --git a/Doc/library/exceptions.rst b/Doc/library/exceptions.rst
index aa31410..42b99cc 100644
--- a/Doc/library/exceptions.rst
+++ b/Doc/library/exceptions.rst
@@ -367,17 +367,21 @@ 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).
+ If a generator code directly or indirectly raises :exc:`StopIteration`,
+ it is 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.
+ Introduced the RuntimeError transformation via
+ ``from __future__ import generator_stop``, see :pep:`479`.
+
+ .. versionchanged:: 3.7
+ Enable :pep:`479` for all code by default: a :exc:`StopIteration`
+ error raised in a generator is transformed into a :exc:`RuntimeError`.
.. exception:: StopAsyncIteration