Commit f9290773 authored by Christian Heimes's avatar Christian Heimes

Reverting last commit. I had some staled data from an attempted svnmerge in my local sandbox

parent e69c320d
......@@ -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.
......
......@@ -413,6 +413,9 @@ generator functions::
... while True:
... try:
... value = (yield value)
... except GeneratorExit:
... # never catch GeneratorExit
... raise
... except Exception, e:
... value = e
... finally:
......
This diff is collapsed.
BaseException
+-- SystemExit
+-- KeyboardInterrupt
+-- GeneratorExit
+-- Exception
+-- GeneratorExit
+-- StopIteration
+-- ArithmeticError
| +-- FloatingPointError
......
......@@ -1668,19 +1668,6 @@ And finalization:
exiting
GeneratorExit is not caught by except Exception:
>>> def f():
... try: yield
... except Exception: print 'except'
... finally: print 'finally'
>>> g = f()
>>> g.next()
>>> del g
finally
Now let's try some ill-behaved generators:
>>> def f():
......
......@@ -245,8 +245,6 @@ Extension Modules
* operator module: div, idiv, __div__, __idiv__, isCallable, sequenceIncludes
* sys module: exc_clear(), exc_type, exc_value, exc_traceback
- Issue #1537: Changed GeneratorExit's base class from Exception to BaseException.
Library
-------
......
......@@ -424,9 +424,9 @@ SimpleExtendsException(PyExc_Exception, StopIteration,
/*
* GeneratorExit extends BaseException
* GeneratorExit extends Exception
*/
SimpleExtendsException(PyExc_BaseException, GeneratorExit,
SimpleExtendsException(PyExc_Exception, GeneratorExit,
"Request that a generator exit.");
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment