Commit c620ff34 authored by Armin Rigo's avatar Armin Rigo

Modify the segfaulting example to show why r53997 is not a solution to

it.
parent 5e9c9e5b
# http://python.org/sf/1303614
class Y(object):
pass
class type_with_modifiable_dict(type, Y):
pass
class MyClass(object):
"""This class has its __dict__ attribute indirectly
exposed via the __dict__ getter/setter of Y.
"""
__metaclass__ = type_with_modifiable_dict
if __name__ == '__main__':
dictattr = Y.__dict__['__dict__']
dictattr.__delete__(MyClass) # if we set tp_dict to NULL,
print MyClass # doing anything with MyClass segfaults
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment