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
85a6d870
Commit
85a6d870
authored
May 13, 2015
by
Kevin Modzelewski
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #526 from undingen/pycrypto4
Add support for METH_OLDARGS and list.pop(long)
parents
6290c7cd
75f1beb7
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
17 additions
and
4 deletions
+17
-4
src/capi/types.h
src/capi/types.h
+13
-0
src/runtime/list.cpp
src/runtime/list.cpp
+2
-3
src/runtime/types.cpp
src/runtime/types.cpp
+1
-1
test/tests/list.py
test/tests/list.py
+1
-0
No files found.
src/capi/types.h
View file @
85a6d870
...
...
@@ -80,6 +80,19 @@ public:
raiseExcHelper
(
TypeError
,
"%s() takes exactly one argument (%d given)"
,
self
->
name
,
varargs
->
size
());
}
rtn
=
(
Box
*
)
self
->
func
(
self
->
passthrough
,
varargs
->
elts
[
0
]);
}
else
if
(
self
->
ml_flags
==
METH_OLDARGS
)
{
/* the really old style */
if
(
kwargs
==
NULL
||
PyDict_Size
(
kwargs
)
==
0
)
{
int
size
=
PyTuple_GET_SIZE
(
varargs
);
Box
*
arg
=
varargs
;
if
(
size
==
1
)
arg
=
PyTuple_GET_ITEM
(
varargs
,
0
);
else
if
(
size
==
0
)
arg
=
NULL
;
rtn
=
self
->
func
(
self
->
passthrough
,
arg
);
}
else
{
raiseExcHelper
(
TypeError
,
"%.200s() takes no keyword arguments"
,
self
->
name
);
}
}
else
{
RELEASE_ASSERT
(
0
,
"0x%x"
,
self
->
ml_flags
);
}
...
...
src/runtime/list.cpp
View file @
85a6d870
...
...
@@ -99,11 +99,10 @@ extern "C" Box* listPop(BoxedList* self, Box* idx) {
return
rtn
;
}
if
(
idx
->
cls
!=
int_cls
)
{
int64_t
n
=
PyInt_AsSsize_t
(
idx
);
if
(
n
==
-
1
&&
PyErr_Occurred
())
raiseExcHelper
(
TypeError
,
"an integer is required"
);
}
int64_t
n
=
static_cast
<
BoxedInt
*>
(
idx
)
->
n
;
if
(
n
<
0
)
n
=
self
->
size
+
n
;
...
...
src/runtime/types.cpp
View file @
85a6d870
...
...
@@ -2584,7 +2584,7 @@ void setupRuntime() {
}
BoxedModule
*
createModule
(
const
std
::
string
&
name
,
const
char
*
fn
,
const
char
*
doc
)
{
assert
(
!
fn
||
strlen
(
fn
)
&&
"probably wanted to set the fn to <stdin>?"
);
assert
(
(
!
fn
||
strlen
(
fn
)
)
&&
"probably wanted to set the fn to <stdin>?"
);
BoxedDict
*
d
=
getSysModulesDict
();
Box
*
b_name
=
boxStringPtr
(
&
name
);
...
...
test/tests/list.py
View file @
85a6d870
...
...
@@ -22,6 +22,7 @@ for i in xrange(-10, 10):
for
i
in
xrange
(
-
5
,
4
):
l3
=
range
(
5
)
print
i
,
l3
.
pop
(
i
),
l3
print
range
(
5
).
pop
(
2L
)
for
i
in
xrange
(
-
5
,
4
):
l3
=
range
(
5
)
...
...
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