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
Boxiang Sun
cython
Commits
05a2cffa
Commit
05a2cffa
authored
Sep 20, 2018
by
Robert Bradshaw
Committed by
GitHub
Sep 20, 2018
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Update ExprNodes.py
parent
871fd4ac
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
5 deletions
+7
-5
Cython/Compiler/ExprNodes.py
Cython/Compiler/ExprNodes.py
+7
-5
No files found.
Cython/Compiler/ExprNodes.py
View file @
05a2cffa
...
...
@@ -187,6 +187,8 @@ def infer_sequence_item_type(env, seq_node, index_node=None, seq_type=None):
return
item_types
.
pop
()
return
None
# Returns a block of code to translate the exception,
# plus a boolean indicating whether to check for Python exceptions.
def
get_exception_handler
(
exception_value
):
if
exception_value
is
None
:
return
"__Pyx_CppExn2PyErr();"
,
False
...
...
@@ -201,11 +203,11 @@ def get_exception_handler(exception_value):
return
'%s(); if (!PyErr_Occurred()) PyErr_SetString(PyExc_RuntimeError , "Error converting c++ exception.");'
%
exception_value
.
entry
.
cname
,
False
def
maybe_check_py_error
(
code
,
check_py_exception
,
pos
,
nogil
):
if
check_py_exception
:
if
nogil
:
code
.
putln
(
code
.
error_goto_if
(
"__Pyx_ErrOccurredWithGIL()"
,
pos
))
else
:
code
.
putln
(
code
.
error_goto_if
(
"PyErr_Occurred()"
,
pos
))
if
check_py_exception
:
if
nogil
:
code
.
putln
(
code
.
error_goto_if
(
"__Pyx_ErrOccurredWithGIL()"
,
pos
))
else
:
code
.
putln
(
code
.
error_goto_if
(
"PyErr_Occurred()"
,
pos
))
def
translate_cpp_exception
(
code
,
pos
,
inside
,
py_result
,
exception_value
,
nogil
):
raise_py_exception
,
check_py_exception
=
get_exception_handler
(
exception_value
)
...
...
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