diff options
author | Amaury Forgeot d'Arc <amauryfa@gmail.com> | 2007-11-13 21:54:28 +0000 |
---|---|---|
committer | Amaury Forgeot d'Arc <amauryfa@gmail.com> | 2007-11-13 21:54:28 +0000 |
commit | aeb66d14a1e4550cee2de821e4adea3e8e5ee690 (patch) | |
tree | aedb0b95d4bd1231e000404ba8e3965dd2fbf0b6 /Lib/distutils/log.py | |
parent | 84f6f7495fe1f5a64623aed04c0fb3419b26dbeb (diff) | |
download | cpython-aeb66d14a1e4550cee2de821e4adea3e8e5ee690.tar.gz |
Merge from py3k branch:
Correction for issue1265 (pdb bug with "with" statement).
When an unfinished generator-iterator is garbage collected, PyEval_EvalFrameEx
is called with a GeneratorExit exception set. This leads to funny results
if the sys.settrace function itself makes use of generators.
A visible effect is that the settrace function is reset to None.
Another is that the eventual "finally" block of the generator is not called.
It is necessary to save/restore the exception around the call to the trace
function.
This happens a lot with py3k: isinstance() of an ABCMeta instance runs
def __instancecheck__(cls, instance):
"""Override for isinstance(instance, cls)."""
return any(cls.__subclasscheck__(c)
for c in {instance.__class__, type(instance)})
which lets an opened generator expression each time it returns True.
Backport candidate, even if the case is less frequent in 2.5.
Diffstat (limited to 'Lib/distutils/log.py')
0 files changed, 0 insertions, 0 deletions