summaryrefslogtreecommitdiffstats
path: root/Doc
diff options
context:
space:
mode:
Diffstat (limited to 'Doc')
-rw-r--r--Doc/library/exceptions.rst7
-rw-r--r--Doc/reference/expressions.rst3
2 files changed, 7 insertions, 3 deletions
diff --git a/Doc/library/exceptions.rst b/Doc/library/exceptions.rst
index d29ce12..3c404e4 100644
--- a/Doc/library/exceptions.rst
+++ b/Doc/library/exceptions.rst
@@ -135,6 +135,13 @@ The following exceptions are the exceptions that are actually raised.
.. exception:: GeneratorExit
+ Raise when a :term:`generator`\'s :meth:`close` method is called. It
+ directly inherits from :exc:`BaseException` instead of :exc:`Exception` since
+ it is technically not an error.
+
+ .. versionchanged:: 3.0
+ Changed to inherit from :exc:`BaseException`.
+
Raise when a :term:`generator`\'s :meth:`close` method is called.
diff --git a/Doc/reference/expressions.rst b/Doc/reference/expressions.rst
index 64f620b..4bb0074 100644
--- a/Doc/reference/expressions.rst
+++ b/Doc/reference/expressions.rst
@@ -413,9 +413,6 @@ generator functions::
... while True:
... try:
... value = (yield value)
- ... except GeneratorExit:
- ... # never catch GeneratorExit
- ... raise
... except Exception, e:
... value = e
... finally: