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
0604fb4f
Commit
0604fb4f
authored
Mar 29, 2016
by
Kevin Modzelewski
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Some support for custom __setattr__ functions
parent
34014196
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
1 addition
and
2 deletions
+1
-2
src/runtime/objmodel.cpp
src/runtime/objmodel.cpp
+1
-2
No files found.
src/runtime/objmodel.cpp
View file @
0604fb4f
...
...
@@ -3001,7 +3001,6 @@ extern "C" void setattr(Box* obj, BoxedString* attr, STOLEN(Box*) attr_val) {
return
;
}
else
if
(
tp_setattro
!=
PyObject_GenericSetAttr
)
{
assert
(
0
&&
"check refcounting"
);
static
BoxedString
*
setattr_str
=
getStaticString
(
"__setattr__"
);
if
(
rewriter
.
get
())
{
GetattrRewriteArgs
rewrite_args
(
rewriter
.
get
(),
rewriter
->
getArg
(
0
)
->
getAttr
(
offsetof
(
Box
,
cls
)),
...
...
@@ -3047,7 +3046,7 @@ extern "C" void setattr(Box* obj, BoxedString* attr, STOLEN(Box*) attr_val) {
// TODO actually rewrite this?
setattr
=
processDescriptor
(
setattr
,
obj
,
obj
->
cls
);
AUTO_DECREF
(
setattr
);
runtimeCallInternal
<
CXX
,
REWRITABLE
>
(
setattr
,
NULL
,
ArgPassSpec
(
2
),
attr
,
attr_val
,
NULL
,
NULL
,
NULL
);
autoDecref
(
runtimeCallInternal
<
CXX
,
REWRITABLE
>
(
setattr
,
NULL
,
ArgPassSpec
(
2
),
attr
,
attr_val
,
NULL
,
NULL
,
NULL
)
);
}
else
{
STAT_TIMER
(
t0
,
"us_timer_slowpath_tpsetattro"
,
10
);
int
r
=
tp_setattro
(
obj
,
attr
,
attr_val
);
...
...
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