• Barry Warsaw's avatar
    Application and elaboration of patch #103305 to fix core dumps when · 0395fdd3
    Barry Warsaw yazdı
    del'ing func.func_dict.  I took the opportunity to also clean up some
    other nits with the code, namely core dumps when del'ing func_defaults
    and KeyError instead of AttributeError when del'ing a non-existant
    function attribute.
    
    Specifically,
    
    func_memberlist: Move func_dict and __dict__ into here instead of
    special casing them in the setattro and getattro methods.  I don't
    remember why I took them out of here before I first uploaded the PEP
    232 patch. :/
    
    func_getattro(): No need to special case __dict__/func_dict since
    their now in the func_memberlist and PyMember_Get() should Do The
    Right Thing (i.e. transforms NULL values into Py_None).
    
    func_setattro(): Document the intended behavior of del'ing or setting
    to None one of the special func_* attributes.  I.e.:
    
        func_code - can only be set to a code object.  It can't be del'd
        or set to None.
    
        func_defaults - can be del'd.  Can only be set to None or a tuple.
    
        func_dict - can be del'd.  Can only be set to None or a
        dictionary.
    
    Fix core dumps and incorrect exceptions as described above.  Also, if
    we're del'ing an arbitrary function attribute but func_dict is NULL,
    don't create func_dict before discovering that we'll get an
    AttributeError anyway.
    0395fdd3
Adı
Son kayıt (commit)
Son güncelleme
..
.cvsignore Loading commit data...
Makefile.in Loading commit data...
abstract.c Loading commit data...
bufferobject.c Loading commit data...
classobject.c Loading commit data...
cobject.c Loading commit data...
complexobject.c Loading commit data...
dictobject.c Loading commit data...
fileobject.c Loading commit data...
floatobject.c Loading commit data...
frameobject.c Loading commit data...
funcobject.c Loading commit data...
intobject.c Loading commit data...
listobject.c Loading commit data...
longobject.c Loading commit data...
methodobject.c Loading commit data...
moduleobject.c Loading commit data...
object.c Loading commit data...
rangeobject.c Loading commit data...
sliceobject.c Loading commit data...
stringobject.c Loading commit data...
tupleobject.c Loading commit data...
typeobject.c Loading commit data...
unicodectype.c Loading commit data...
unicodeobject.c Loading commit data...
unicodetype_db.h Loading commit data...
xxobject.c Loading commit data...