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
Labels
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Commits
Open sidebar
nexedi
cython
Commits
4fc5eee9
Commit
4fc5eee9
authored
Jul 19, 2008
by
Dag Sverre Seljebotn
Browse files
Options
Browse Files
Download
Plain Diff
Merging with cython-devel again
parents
be78fb70
aa7b209d
Changes
5
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
32 additions
and
32 deletions
+32
-32
Cython/Compiler/ExprNodes.py
Cython/Compiler/ExprNodes.py
+7
-18
Cython/Compiler/ModuleNode.py
Cython/Compiler/ModuleNode.py
+0
-3
Cython/Compiler/Naming.py
Cython/Compiler/Naming.py
+0
-1
Cython/Compiler/Nodes.py
Cython/Compiler/Nodes.py
+3
-10
tests/run/nogil.pyx
tests/run/nogil.pyx
+22
-0
No files found.
Cython/Compiler/ExprNodes.py
View file @
4fc5eee9
...
...
@@ -1678,17 +1678,6 @@ class SimpleCallNode(CallNode):
func_type
=
func_type
.
base_type
return
func_type
def
exception_checks
(
self
):
func_type
=
self
.
function_type
()
exc_val
=
func_type
.
exception_value
exc_check
=
func_type
.
exception_check
if
exc_val
is
None
and
self
.
function
.
entry
.
visibility
!=
'extern'
:
return_type
=
func_type
.
return_type
if
not
return_type
.
is_struct_or_union
and
not
return_type
.
is_void
:
exc_val
=
return_type
.
cast_code
(
Naming
.
default_error
)
exc_check
=
1
return
exc_val
,
exc_check
def
analyse_c_function_call
(
self
,
env
):
func_type
=
self
.
function_type
()
# Check function type
...
...
@@ -1730,13 +1719,12 @@ class SimpleCallNode(CallNode):
"Python object cannot be passed as a varargs parameter"
)
# Calc result type and code fragment
self
.
type
=
func_type
.
return_type
if
self
.
type
.
is_pyobject
:
if
self
.
type
.
is_pyobject
\
or
func_type
.
exception_value
is
not
None
\
or
func_type
.
exception_check
:
self
.
is_temp
=
1
if
self
.
type
.
is_pyobject
:
self
.
result_ctype
=
py_object_type
else
:
exc_val
,
exc_check
=
self
.
exception_checks
()
if
self
.
type
.
is_pyobject
or
exc_val
is
not
None
or
exc_check
:
self
.
is_temp
=
1
# C++ exception handler
if
func_type
.
exception_check
==
'+'
:
if
func_type
.
exception_value
is
None
:
...
...
@@ -1801,7 +1789,8 @@ class SimpleCallNode(CallNode):
if
self
.
type
.
is_pyobject
:
exc_checks
.
append
(
"!%s"
%
self
.
result_code
)
else
:
exc_val
,
exc_check
=
self
.
exception_checks
()
exc_val
=
func_type
.
exception_value
exc_check
=
func_type
.
exception_check
if
exc_val
is
not
None
:
exc_checks
.
append
(
"%s == %s"
%
(
self
.
result_code
,
exc_val
))
if
exc_check
:
...
...
Cython/Compiler/ModuleNode.py
View file @
4fc5eee9
...
...
@@ -487,9 +487,6 @@ class ModuleNode(Nodes.Node, Nodes.BlockNode):
code
.
putln
(
"#ifndef __cdecl"
)
code
.
putln
(
" #define __cdecl"
)
code
.
putln
(
"#endif"
)
code
.
putln
(
''
);
code
.
putln
(
'#define %s 0xB0000000B000B0BBLL'
%
Naming
.
default_error
);
code
.
putln
(
''
);
self
.
generate_extern_c_macro_definition
(
code
)
code
.
putln
(
"#include <math.h>"
)
code
.
putln
(
"#define %s"
%
Naming
.
api_guard_prefix
+
self
.
api_name
(
env
))
...
...
Cython/Compiler/Naming.py
View file @
4fc5eee9
...
...
@@ -74,7 +74,6 @@ import_star = pyrex_prefix + "import_star"
import_star_set
=
pyrex_prefix
+
"import_star_set"
cur_scope_cname
=
pyrex_prefix
+
"cur_scope"
enc_scope_cname
=
pyrex_prefix
+
"enc_scope"
default_error
=
pyrex_prefix
+
"ERROR"
line_c_macro
=
"__LINE__"
...
...
Cython/Compiler/Nodes.py
View file @
4fc5eee9
...
...
@@ -1213,17 +1213,10 @@ class CFuncDefNode(FuncDefNode):
if
self
.
return_type
.
is_pyobject
:
return
"0"
else
:
if
self
.
entry
.
type
.
exception_value
is
not
None
:
#return None
return
self
.
entry
.
type
.
exception_value
elif
self
.
return_type
.
is_struct_or_union
or
self
.
return_type
.
is_void
:
return
None
else
:
return
self
.
return_type
.
cast_code
(
Naming
.
default_error
)
def
caller_will_check_exceptions
(
self
):
if
self
.
entry
.
type
.
exception_value
is
None
:
return
1
else
:
return
self
.
entry
.
type
.
exception_check
def
generate_optarg_wrapper_function
(
self
,
env
,
code
):
...
...
tests/run/nogil.pyx
0 → 100644
View file @
4fc5eee9
__doc__
=
u"""
>>> test(5)
47
>>> test(11)
53
"""
def
test
(
int
x
):
with
nogil
:
f
(
x
)
x
=
g
(
x
)
return
x
cdef
void
f
(
int
x
)
nogil
:
cdef
int
y
y
=
x
+
42
g
(
y
)
cdef
int
g
(
int
x
)
nogil
:
cdef
int
y
y
=
x
+
42
return
y
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