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
Gwenaël Samain
cython
Commits
afb84985
Commit
afb84985
authored
Oct 18, 2014
by
Robert Bradshaw
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Allow cpdef void-returning functions.
parent
8a2ea03d
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
21 additions
and
1 deletion
+21
-1
Cython/Compiler/ExprNodes.py
Cython/Compiler/ExprNodes.py
+1
-1
Cython/Compiler/PyrexTypes.py
Cython/Compiler/PyrexTypes.py
+1
-0
Cython/Utility/ModuleSetupCode.c
Cython/Utility/ModuleSetupCode.c
+2
-0
tests/run/cpdef.pyx
tests/run/cpdef.pyx
+17
-0
No files found.
Cython/Compiler/ExprNodes.py
View file @
afb84985
...
...
@@ -11182,7 +11182,7 @@ class CoerceToPyTypeNode(CoercionNode):
func
=
func
.
replace
(
"Object"
,
self
.
type
.
name
.
title
(),
1
)
elif
self
.
type
is
bytearray_type
:
func
=
func
.
replace
(
"Object"
,
"ByteArray"
,
1
)
funccall
=
"%s(%s)"
%
(
func
,
self
.
arg
.
result
())
funccall
=
"%s(%s)"
%
(
func
,
self
.
arg
.
result
()
or
'NULL'
)
code
.
putln
(
'%s = %s; %s'
%
(
self
.
result
(),
...
...
Cython/Compiler/PyrexTypes.py
View file @
afb84985
...
...
@@ -1307,6 +1307,7 @@ class CVoidType(CType):
#
is_void
=
1
to_py_function
=
"__Pyx_void_to_None"
def
__repr__
(
self
):
return
"<CVoidType>"
...
...
Cython/Utility/ModuleSetupCode.c
View file @
afb84985
...
...
@@ -215,6 +215,8 @@ static CYTHON_INLINE float __PYX_NAN() {
}
#endif
#define __Pyx_void_to_None(void_result) (void_result, Py_INCREF(Py_None), Py_None)
// Work around clang bug http://stackoverflow.com/questions/21847816/c-invoke-nested-template-class-destructor
#ifdef __cplusplus
template
<
typename
T
>
...
...
tests/run/cpdef.pyx
0 → 100644
View file @
afb84985
cpdef
void
unraisable
():
"""
>>> unraisable()
here
"""
print
(
'here'
)
raise
RuntimeError
()
cpdef
void
raisable
()
except
*
:
"""
>>> raisable()
Traceback (most recent call last):
...
RuntimeError
"""
print
(
'here'
)
raise
RuntimeError
()
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