Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
cpython
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
cpython
Commits
c620ff34
Commit
c620ff34
authored
Feb 28, 2007
by
Armin Rigo
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Modify the segfaulting example to show why r53997 is not a solution to
it.
parent
5e9c9e5b
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
20 additions
and
0 deletions
+20
-0
Lib/test/crashers/modify_dict_attr.py
Lib/test/crashers/modify_dict_attr.py
+20
-0
No files found.
Lib/test/crashers/modify_dict_attr.py
0 → 100644
View file @
c620ff34
# 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
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment