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
258a185b
Commit
258a185b
authored
Oct 22, 2009
by
Robert Bradshaw
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix cpp exception catching.
parent
72b07822
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
4 deletions
+10
-4
Cython/Compiler/Nodes.py
Cython/Compiler/Nodes.py
+10
-4
No files found.
Cython/Compiler/Nodes.py
View file @
258a185b
...
...
@@ -547,17 +547,23 @@ class CFuncDeclaratorNode(CDeclaratorNode):
if
self
.
exception_value
:
self
.
exception_value
.
analyse_const_expression
(
env
)
if
self
.
exception_check
==
'+'
:
self
.
exception_value
.
analyse_types
(
env
)
exc_val_type
=
self
.
exception_value
.
type
if
not
exc_val_type
.
is_error
and
\
not
exc_val_type
.
is_pyobject
and
\
not
(
exc_val_type
.
is_cfunction
and
not
exc_val_type
.
return_type
.
is_pyobject
and
len
(
exc_val_type
.
args
)
==
0
):
error
(
self
.
exception_value
.
pos
,
"Exception value must be a Python exception or cdef function with no arguments."
)
exc_val
=
self
.
exception_value
else
:
exc_val
=
self
.
exception_value
.
get_constant_c_result_code
()
if
not
return_type
.
assignable_from
(
self
.
exception_value
.
type
):
error
(
self
.
exception_value
.
pos
,
"Exception value incompatible with function return type"
)
if
self
.
exception_value
.
analyse_const_expression
(
env
):
exc_val
=
self
.
exception_value
.
get_constant_c_result_code
()
if
exc_val
is
None
:
raise
InternalError
(
"get_constant_c_result_code not implemented for %s"
%
self
.
exception_value
.
__class__
.
__name__
)
if
not
return_type
.
assignable_from
(
self
.
exception_value
.
type
):
error
(
self
.
exception_value
.
pos
,
"Exception value incompatible with function return type"
)
exc_check
=
self
.
exception_check
if
return_type
.
is_array
:
error
(
self
.
pos
,
...
...
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