Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
cython
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
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Xavier Thompson
cython
Commits
e8a6ad76
Commit
e8a6ad76
authored
Jul 09, 2017
by
scoder
Committed by
GitHub
Jul 09, 2017
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #1728 from jdemeyer/call_one_arg_no_cyfunction
Don't use __Pyx_PyObject_CallMethO on cyfunctions
parents
78b1c068
50e7a673
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
16 additions
and
4 deletions
+16
-4
Cython/Utility/ObjectHandling.c
Cython/Utility/ObjectHandling.c
+0
-4
tests/run/cyfunction_METH_O_GH1728.pyx
tests/run/cyfunction_METH_O_GH1728.pyx
+16
-0
No files found.
Cython/Utility/ObjectHandling.c
View file @
e8a6ad76
...
@@ -1686,11 +1686,7 @@ static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObjec
...
@@ -1686,11 +1686,7 @@ static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObjec
return
__Pyx_PyFunction_FastCall
(
func
,
&
arg
,
1
);
return
__Pyx_PyFunction_FastCall
(
func
,
&
arg
,
1
);
}
}
#endif
#endif
#ifdef __Pyx_CyFunction_USED
if
(
likely
(
PyCFunction_Check
(
func
)
||
PyObject_TypeCheck
(
func
,
__pyx_CyFunctionType
)))
{
#else
if
(
likely
(
PyCFunction_Check
(
func
)))
{
if
(
likely
(
PyCFunction_Check
(
func
)))
{
#endif
if
(
likely
(
PyCFunction_GET_FLAGS
(
func
)
&
METH_O
))
{
if
(
likely
(
PyCFunction_GET_FLAGS
(
func
)
&
METH_O
))
{
// fast and simple case that we are optimising for
// fast and simple case that we are optimising for
return
__Pyx_PyObject_CallMethO
(
func
,
arg
);
return
__Pyx_PyObject_CallMethO
(
func
,
arg
);
...
...
tests/run/cyfunction_METH_O_GH1728.pyx
0 → 100644
View file @
e8a6ad76
# cython: binding=True
# mode: run
# tag: cyfunction
cdef
class
TestMethodOneArg
:
def
meth
(
self
,
arg
):
pass
def
call_meth
(
x
):
"""
>>> call_meth(TestMethodOneArg())
Traceback (most recent call last):
...
TypeError: meth() takes exactly one argument (0 given)
"""
return
x
.
meth
()
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