diff options
| author | Armin Rigo <arigo@tunes.org> | 2007-02-28 09:25:29 (GMT) |
|---|---|---|
| committer | Armin Rigo <arigo@tunes.org> | 2007-02-28 09:25:29 (GMT) |
| commit | adf172339cd8299d32cf8022f769d82603bb31e5 (patch) | |
| tree | 7f05029be18276c22973bad3b2e7615a036f6c7d | |
| parent | cca75403c488c067eed2626446fa5d2dc6164b4f (diff) | |
| download | cpython-adf172339cd8299d32cf8022f769d82603bb31e5.zip cpython-adf172339cd8299d32cf8022f769d82603bb31e5.tar.gz cpython-adf172339cd8299d32cf8022f769d82603bb31e5.tar.bz2 | |
Modify the segfaulting example to show why r53997 is not a solution to
it.
| -rw-r--r-- | Lib/test/crashers/modify_dict_attr.py | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/Lib/test/crashers/modify_dict_attr.py b/Lib/test/crashers/modify_dict_attr.py new file mode 100644 index 0000000..11c6721 --- /dev/null +++ b/Lib/test/crashers/modify_dict_attr.py @@ -0,0 +1,20 @@ + +# 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 |
