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
e71d885b
Commit
e71d885b
authored
Jun 29, 2011
by
Lars Buitinck
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Handle std::ios_base::failure as well as possible
parent
f7715b63
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
5 additions
and
0 deletions
+5
-0
Cython/Compiler/ExprNodes.py
Cython/Compiler/ExprNodes.py
+4
-0
Cython/Compiler/Nodes.py
Cython/Compiler/Nodes.py
+1
-0
No files found.
Cython/Compiler/ExprNodes.py
View file @
e71d885b
...
@@ -8228,6 +8228,10 @@ static void __Pyx_CppExn2PyErr() {
...
@@ -8228,6 +8228,10 @@ static void __Pyx_CppExn2PyErr() {
PyErr_SetString(PyExc_ValueError, exn.what());
PyErr_SetString(PyExc_ValueError, exn.what());
} catch (const std::bad_alloc& exn) {
} catch (const std::bad_alloc& exn) {
PyErr_SetString(PyExc_MemoryError, exn.what());
PyErr_SetString(PyExc_MemoryError, exn.what());
} catch (const std::ios_base::failure& exn) {
// Unfortunately, in standard C++ we have no way of distinguishing EOF
// from other errors here; be careful with the exception mask
PyErr_SetString(PyExc_IOError, exn.what());
} catch (const std::out_of_range& exn) {
} catch (const std::out_of_range& exn) {
// Change out_of_range to IndexError
// Change out_of_range to IndexError
PyErr_SetString(PyExc_IndexError, exn.what());
PyErr_SetString(PyExc_IndexError, exn.what());
...
...
Cython/Compiler/Nodes.py
View file @
e71d885b
...
@@ -577,6 +577,7 @@ class CFuncDeclaratorNode(CDeclaratorNode):
...
@@ -577,6 +577,7 @@ class CFuncDeclaratorNode(CDeclaratorNode):
exc_val
=
None
exc_val
=
None
exc_check
=
0
exc_check
=
0
if
self
.
exception_check
==
'+'
:
if
self
.
exception_check
==
'+'
:
env
.
add_include_file
(
'ios'
)
# for std::ios_base::failure
env
.
add_include_file
(
'new'
)
# for std::bad_alloc
env
.
add_include_file
(
'new'
)
# for std::bad_alloc
env
.
add_include_file
(
'stdexcept'
)
env
.
add_include_file
(
'stdexcept'
)
if
return_type
.
is_pyobject
\
if
return_type
.
is_pyobject
\
...
...
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