• Amaury Forgeot d'Arc's avatar
    Correction for issue1265 (pdb bug with "with" statement). · f05149a2
    Amaury Forgeot d'Arc yazdı
    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.
    
    Seems a backport candidate, even if the case is less frequent in 2.5.
    f05149a2
Adı
Son kayıt (commit)
Son güncelleme
Demo Loading commit data...
Doc Loading commit data...
Grammar Loading commit data...
Include Loading commit data...
Lib Loading commit data...
Mac Loading commit data...
Misc Loading commit data...
Modules Loading commit data...
Objects Loading commit data...
PC Loading commit data...
PCbuild Loading commit data...
PCbuild8 Loading commit data...
Parser Loading commit data...
Python Loading commit data...
Tools Loading commit data...
.hgtags Loading commit data...
INTBENCH Loading commit data...
LICENSE Loading commit data...
Makefile.pre.in Loading commit data...
README Loading commit data...
RELNOTES Loading commit data...
configure Loading commit data...
configure.in Loading commit data...
install-sh Loading commit data...
pyconfig.h.in Loading commit data...
runtests.sh Loading commit data...
setup.py Loading commit data...