diff options
Diffstat (limited to 'Doc')
| -rw-r--r-- | Doc/library/exceptions.rst | 7 | ||||
| -rw-r--r-- | Doc/reference/expressions.rst | 3 |
2 files changed, 3 insertions, 7 deletions
diff --git a/Doc/library/exceptions.rst b/Doc/library/exceptions.rst index 3c404e417a..d29ce12d63 100644 --- a/Doc/library/exceptions.rst +++ b/Doc/library/exceptions.rst @@ -135,13 +135,6 @@ 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 4bb0074df1..64f620b74d 100644 --- a/Doc/reference/expressions.rst +++ b/Doc/reference/expressions.rst @@ -413,6 +413,9 @@ generator functions:: ... while True: ... try: ... value = (yield value) + ... except GeneratorExit: + ... # never catch GeneratorExit + ... raise ... except Exception, e: ... value = e ... finally: |
