summaryrefslogtreecommitdiff
path: root/Python/ast.c
diff options
context:
space:
mode:
authorAmaury Forgeot d'Arc <amauryfa@gmail.com>2007-11-13 22:43:05 +0000
committerAmaury Forgeot d'Arc <amauryfa@gmail.com>2007-11-13 22:43:05 +0000
commitc572dc3752871a48127db1fb3c8bc20889d2be34 (patch)
tree1dd5cb18cea5fcaa1a91a53413dfe3a3ea918a3e /Python/ast.c
parentf5ccd459d767464d7033f6ef7ba73a53e3eae268 (diff)
downloadcpython-git-c572dc3752871a48127db1fb3c8bc20889d2be34.tar.gz
Backport 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. And the problem can be reproduced in 2.5 with pure python code.
Diffstat (limited to 'Python/ast.c')
0 files changed, 0 insertions, 0 deletions