summaryrefslogtreecommitdiff
path: root/Python/bltinmodule.c
diff options
context:
space:
mode:
authorBarry Warsaw <barry@python.org>2001-01-19 19:53:29 +0000
committerBarry Warsaw <barry@python.org>2001-01-19 19:53:29 +0000
commit0395fdd3a9249356f6efde5f8a5313df2d0c2b8c (patch)
tree912fe291023f2ac29672d0a74106327d26f21124 /Python/bltinmodule.c
parent7c1e4bbe25d3f9d044daa7f24b182e8e40112ad3 (diff)
downloadcpython-git-0395fdd3a9249356f6efde5f8a5313df2d0c2b8c.tar.gz
Application and elaboration of patch #103305 to fix core dumps when
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.
Diffstat (limited to 'Python/bltinmodule.c')
0 files changed, 0 insertions, 0 deletions