Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
P
Pyston
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
Boxiang Sun
Pyston
Commits
01fb5d0b
Commit
01fb5d0b
authored
Feb 09, 2016
by
Marius Wachtler
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
don't crash when deleting nonexisting instance attributes
parent
1f4a1b09
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
12 additions
and
1 deletion
+12
-1
src/runtime/classobj.cpp
src/runtime/classobj.cpp
+8
-1
test/tests/oldstyle_classes.py
test/tests/oldstyle_classes.py
+4
-0
No files found.
src/runtime/classobj.cpp
View file @
01fb5d0b
...
...
@@ -587,7 +587,14 @@ Box* instanceDelattr(Box* _inst, Box* _attr) {
return
runtimeCall
(
delattr
,
ArgPassSpec
(
1
),
_attr
,
NULL
,
NULL
,
NULL
,
NULL
);
}
_inst
->
delattr
(
attr
,
NULL
);
if
(
_inst
->
hasattr
(
attr
))
_inst
->
delattr
(
attr
,
NULL
);
else
{
BoxedClassobj
*
clsobj
=
(
BoxedClassobj
*
)
inst
->
inst_cls
;
RELEASE_ASSERT
(
PyClass_Check
(
clsobj
),
""
);
raiseExcHelper
(
AttributeError
,
"%.50s instance has no attribute '%.400s'"
,
clsobj
->
name
->
c_str
(),
attr
->
c_str
());
}
return
None
;
}
...
...
test/tests/oldstyle_classes.py
View file @
01fb5d0b
...
...
@@ -387,6 +387,10 @@ try:
C
.
doesnt_exist
except
AttributeError
as
e
:
print
e
try
:
del
C
().
doesnt_exist
except
AttributeError
as
e
:
print
e
class
C
():
...
...
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