• Barry Warsaw's avatar
    abstract_get_bases(): Clarify exactly what the return values and · f16951cf
    Barry Warsaw yazdı
    states can be for this function, and ensure that only AttributeErrors
    are masked.  Any other exception raised via the equivalent of
    getattr(cls, '__bases__') should be propagated up.
    
    abstract_issubclass(): If abstract_get_bases() returns NULL, we must
    call PyErr_Occurred() to see if an exception is being propagated, and
    return -1 or 0 as appropriate.  This is the specific fix for a problem
    whereby if getattr(derived, '__bases__') raised an exception, an
    "undetected error" would occur (under a debug build).  This nasty
    situation was uncovered when writing a security proxy extension type
    for the Zope3 project, where the security proxy raised a Forbidden
    exception on getattr of __bases__.
    
    PyObject_IsInstance(), PyObject_IsSubclass(): After both calls to
    abstract_get_bases(), where we're setting the TypeError if the return
    value is NULL, we must first check to see if an exception occurred,
    and /not/ mask an existing exception.
    
    Neil Schemenauer should double check that these changes don't break
    his ExtensionClass examples (there aren't any test cases for those
    examples and abstract_get_bases() was added by him in response to
    problems with ExtensionClass).  Neil, please add test cases if
    possible!
    
    I belive this is a bug fix candidate for Python 2.2.2.
    f16951cf
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...
Parser Loading commit data...
Python Loading commit data...
RISCOS Loading commit data...
Tools Loading commit data...
.cvsignore Loading commit data...
.hgtags Loading commit data...
LICENSE Loading commit data...
Makefile.pre.in Loading commit data...
PLAN.txt Loading commit data...
README Loading commit data...
configure Loading commit data...
configure.in Loading commit data...
install-sh Loading commit data...
pyconfig.h.in Loading commit data...
setup.py Loading commit data...