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
2642c04e
Commit
2642c04e
authored
Feb 19, 2015
by
Kevin Modzelewski
Browse files
Options
Browse Files
Download
Plain Diff
Merge #304
I added a bugfix to this branch for merging
parents
466b5204
8ad1f5b3
Changes
6
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
35 additions
and
4 deletions
+35
-4
libunwind
libunwind
+1
-1
src/runtime/builtin_modules/builtins.cpp
src/runtime/builtin_modules/builtins.cpp
+1
-1
src/runtime/types.cpp
src/runtime/types.cpp
+18
-0
test/tests/functools_test.py
test/tests/functools_test.py
+15
-0
test/tests/property.py
test/tests/property.py
+0
-1
test/tests/thread_spawning.py
test/tests/thread_spawning.py
+0
-1
No files found.
libunwind
@
68a2910b
Subproject commit
c90a2e02b3c1b03362a549a05261a4d0513d6026
Subproject commit
68a2910bae7ed1bff8e1e03cd7239bfd7e1cfe79
src/runtime/builtin_modules/builtins.cpp
View file @
2642c04e
...
...
@@ -459,7 +459,7 @@ Box* getattrFunc(Box* obj, Box* _str, Box* default_value) {
Box
*
rtn
=
NULL
;
try
{
rtn
=
getattr
Internal
(
obj
,
str
->
s
,
NULL
);
rtn
=
getattr
(
obj
,
str
->
s
.
c_str
()
);
}
catch
(
ExcInfo
e
)
{
if
(
!
e
.
matches
(
AttributeError
))
throw
e
;
...
...
src/runtime/types.cpp
View file @
2642c04e
...
...
@@ -978,6 +978,23 @@ public:
HCAttrs
*
attrs
=
self
->
b
->
getHCAttrsPtr
();
return
boxInt
(
attrs
->
hcls
->
attr_offsets
.
size
());
}
static
Box
*
update
(
Box
*
_self
,
Box
*
_container
)
{
RELEASE_ASSERT
(
_self
->
cls
==
attrwrapper_cls
,
""
);
AttrWrapper
*
self
=
static_cast
<
AttrWrapper
*>
(
_self
);
if
(
_container
->
cls
==
attrwrapper_cls
)
{
AttrWrapper
*
container
=
static_cast
<
AttrWrapper
*>
(
_container
);
HCAttrs
*
attrs
=
container
->
b
->
getHCAttrsPtr
();
for
(
const
auto
&
p
:
attrs
->
hcls
->
attr_offsets
)
{
self
->
b
->
setattr
(
p
.
first
,
attrs
->
attr_list
->
attrs
[
p
.
second
],
NULL
);
}
}
else
{
RELEASE_ASSERT
(
0
,
"not implemented"
);
}
return
None
;
}
};
Box
*
makeAttrWrapper
(
Box
*
b
)
{
...
...
@@ -1317,6 +1334,7 @@ void setupRuntime() {
attrwrapper_cls
->
giveAttr
(
"values"
,
new
BoxedFunction
(
boxRTFunction
((
void
*
)
AttrWrapper
::
values
,
LIST
,
1
)));
attrwrapper_cls
->
giveAttr
(
"items"
,
new
BoxedFunction
(
boxRTFunction
((
void
*
)
AttrWrapper
::
items
,
LIST
,
1
)));
attrwrapper_cls
->
giveAttr
(
"__len__"
,
new
BoxedFunction
(
boxRTFunction
((
void
*
)
AttrWrapper
::
len
,
BOXED_INT
,
1
)));
attrwrapper_cls
->
giveAttr
(
"update"
,
new
BoxedFunction
(
boxRTFunction
((
void
*
)
AttrWrapper
::
update
,
NONE
,
2
)));
attrwrapper_cls
->
freeze
();
// sys is the first module that needs to be set up, due to modules
...
...
test/tests/functools_test.py
View file @
2642c04e
...
...
@@ -3,3 +3,18 @@ import functools
f
=
functools
.
partial
(
lambda
*
args
:
args
,
1
,
23
)
print
f
(
"hello"
)
print
f
(
"world"
,
5
)
def
foo
(
x
=
1
,
y
=
2
):
print
' inside foo:'
,
x
,
y
return
def
wrapper
(
f
):
@
functools
.
wraps
(
f
)
def
decorated
(
x
=
2
,
y
=
3
):
f
(
x
,
y
)
return
decorated
for
f
in
[
foo
,
wrapper
(
foo
)]:
print
f
.
__name__
f
()
f
(
3
)
test/tests/property.py
View file @
2642c04e
# fail-if: '-x' in EXTRA_JIT_ARGS
# I think pypa has an issue parsing decorator expressions if they aren't simple names
# https://github.com/vinzenz/libpypa/issues/15
...
...
test/tests/thread_spawning.py
View file @
2642c04e
# allow-warning: converting unicode literal to str
# fail-if: '-x' in EXTRA_JIT_ARGS
# Make sure we can spawn a bunch of threads
...
...
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