diff options
author | Christian Heimes <christian@cheimes.de> | 2007-12-03 19:47:54 (GMT) |
---|---|---|
committer | Christian Heimes <christian@cheimes.de> | 2007-12-03 19:47:54 (GMT) |
commit | e69c320d48a5708c900cc6c78bf006fef68c62bd (patch) | |
tree | 04e85c6cfaf9f5b6eb1a79a263e5cf6e51cc1ae9 /Doc | |
parent | 6554cb94ba328939366ac6f12104d70d52d57cdd (diff) | |
download | cpython-e69c320d48a5708c900cc6c78bf006fef68c62bd.zip cpython-e69c320d48a5708c900cc6c78bf006fef68c62bd.tar.gz cpython-e69c320d48a5708c900cc6c78bf006fef68c62bd.tar.bz2 |
Patch #1537 from Chad Austin
Change GeneratorExit's base class from Exception to BaseException
Diffstat (limited to 'Doc')
-rw-r--r-- | Doc/library/exceptions.rst | 7 | ||||
-rw-r--r-- | Doc/reference/expressions.rst | 3 |
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: |