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
1f56d4e3
Commit
1f56d4e3
authored
Oct 28, 2017
by
scoder
Committed by
GitHub
Oct 28, 2017
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #1956 from tacaswell/fix_37
FIX: account for change in how exception information is stored
parents
30496991
fdf4451e
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
42 additions
and
0 deletions
+42
-0
Cython/Utility/Exceptions.c
Cython/Utility/Exceptions.c
+42
-0
No files found.
Cython/Utility/Exceptions.c
View file @
1f56d4e3
...
@@ -359,12 +359,21 @@ static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb)
...
@@ -359,12 +359,21 @@ static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb)
*
value
=
local_value
;
*
value
=
local_value
;
*
tb
=
local_tb
;
*
tb
=
local_tb
;
#if CYTHON_FAST_THREAD_STATE
#if CYTHON_FAST_THREAD_STATE
#if PY_MAJOR_VERSION >= 3 && PY_MINOR_VERSION >= 7
tmp_type
=
tstate
->
exc_state
.
exc_type
;
tmp_value
=
tstate
->
exc_state
.
exc_value
;
tmp_tb
=
tstate
->
exc_state
.
exc_traceback
;
tstate
->
exc_state
.
exc_type
=
local_type
;
tstate
->
exc_state
.
exc_value
=
local_value
;
tstate
->
exc_state
.
exc_traceback
=
local_tb
;
#else
tmp_type
=
tstate
->
exc_type
;
tmp_type
=
tstate
->
exc_type
;
tmp_value
=
tstate
->
exc_value
;
tmp_value
=
tstate
->
exc_value
;
tmp_tb
=
tstate
->
exc_traceback
;
tmp_tb
=
tstate
->
exc_traceback
;
tstate
->
exc_type
=
local_type
;
tstate
->
exc_type
=
local_type
;
tstate
->
exc_value
=
local_value
;
tstate
->
exc_value
=
local_value
;
tstate
->
exc_traceback
=
local_tb
;
tstate
->
exc_traceback
=
local_tb
;
#endif
// Make sure tstate is in a consistent state when we XDECREF
// Make sure tstate is in a consistent state when we XDECREF
// these objects (DECREF may run arbitrary code).
// these objects (DECREF may run arbitrary code).
Py_XDECREF
(
tmp_type
);
Py_XDECREF
(
tmp_type
);
...
@@ -394,9 +403,15 @@ static CYTHON_INLINE void __Pyx_ReraiseException(void) {
...
@@ -394,9 +403,15 @@ static CYTHON_INLINE void __Pyx_ReraiseException(void) {
PyObject
*
type
=
NULL
,
*
value
=
NULL
,
*
tb
=
NULL
;
PyObject
*
type
=
NULL
,
*
value
=
NULL
,
*
tb
=
NULL
;
#if CYTHON_FAST_THREAD_STATE
#if CYTHON_FAST_THREAD_STATE
PyThreadState
*
tstate
=
PyThreadState_GET
();
PyThreadState
*
tstate
=
PyThreadState_GET
();
#if PY_MAJOR_VERSION >= 3 && PY_MINOR_VERSION >= 7
type
=
tstate
->
exc_state
.
exc_type
;
value
=
tstate
->
exc_state
.
exc_value
;
tb
=
tstate
->
exc_state
.
exc_traceback
;
#else
type
=
tstate
->
exc_type
;
type
=
tstate
->
exc_type
;
value
=
tstate
->
exc_value
;
value
=
tstate
->
exc_value
;
tb
=
tstate
->
exc_traceback
;
tb
=
tstate
->
exc_traceback
;
#endif
#else
#else
PyErr_GetExcInfo
(
&
type
,
&
value
,
&
tb
);
PyErr_GetExcInfo
(
&
type
,
&
value
,
&
tb
);
#endif
#endif
...
@@ -440,9 +455,15 @@ static CYTHON_INLINE void __Pyx__ExceptionReset(PyThreadState *tstate, PyObject
...
@@ -440,9 +455,15 @@ static CYTHON_INLINE void __Pyx__ExceptionReset(PyThreadState *tstate, PyObject
#if CYTHON_FAST_THREAD_STATE
#if CYTHON_FAST_THREAD_STATE
static
CYTHON_INLINE
void
__Pyx__ExceptionSave
(
PyThreadState
*
tstate
,
PyObject
**
type
,
PyObject
**
value
,
PyObject
**
tb
)
{
static
CYTHON_INLINE
void
__Pyx__ExceptionSave
(
PyThreadState
*
tstate
,
PyObject
**
type
,
PyObject
**
value
,
PyObject
**
tb
)
{
#if PY_MAJOR_VERSION >= 3 && PY_MINOR_VERSION >= 7
*
type
=
tstate
->
exc_state
.
exc_type
;
*
value
=
tstate
->
exc_state
.
exc_value
;
*
tb
=
tstate
->
exc_state
.
exc_traceback
;
#else
*
type
=
tstate
->
exc_type
;
*
type
=
tstate
->
exc_type
;
*
value
=
tstate
->
exc_value
;
*
value
=
tstate
->
exc_value
;
*
tb
=
tstate
->
exc_traceback
;
*
tb
=
tstate
->
exc_traceback
;
#endif
Py_XINCREF
(
*
type
);
Py_XINCREF
(
*
type
);
Py_XINCREF
(
*
value
);
Py_XINCREF
(
*
value
);
Py_XINCREF
(
*
tb
);
Py_XINCREF
(
*
tb
);
...
@@ -450,12 +471,22 @@ static CYTHON_INLINE void __Pyx__ExceptionSave(PyThreadState *tstate, PyObject *
...
@@ -450,12 +471,22 @@ static CYTHON_INLINE void __Pyx__ExceptionSave(PyThreadState *tstate, PyObject *
static
CYTHON_INLINE
void
__Pyx__ExceptionReset
(
PyThreadState
*
tstate
,
PyObject
*
type
,
PyObject
*
value
,
PyObject
*
tb
)
{
static
CYTHON_INLINE
void
__Pyx__ExceptionReset
(
PyThreadState
*
tstate
,
PyObject
*
type
,
PyObject
*
value
,
PyObject
*
tb
)
{
PyObject
*
tmp_type
,
*
tmp_value
,
*
tmp_tb
;
PyObject
*
tmp_type
,
*
tmp_value
,
*
tmp_tb
;
#if PY_MAJOR_VERSION >= 3 && PY_MINOR_VERSION >= 7
tmp_type
=
tstate
->
exc_state
.
exc_type
;
tmp_value
=
tstate
->
exc_state
.
exc_value
;
tmp_tb
=
tstate
->
exc_state
.
exc_traceback
;
tstate
->
exc_state
.
exc_type
=
type
;
tstate
->
exc_state
.
exc_value
=
value
;
tstate
->
exc_state
.
exc_traceback
=
tb
;
#else
tmp_type
=
tstate
->
exc_type
;
tmp_type
=
tstate
->
exc_type
;
tmp_value
=
tstate
->
exc_value
;
tmp_value
=
tstate
->
exc_value
;
tmp_tb
=
tstate
->
exc_traceback
;
tmp_tb
=
tstate
->
exc_traceback
;
tstate
->
exc_type
=
type
;
tstate
->
exc_type
=
type
;
tstate
->
exc_value
=
value
;
tstate
->
exc_value
=
value
;
tstate
->
exc_traceback
=
tb
;
tstate
->
exc_traceback
=
tb
;
#endif
Py_XDECREF
(
tmp_type
);
Py_XDECREF
(
tmp_type
);
Py_XDECREF
(
tmp_value
);
Py_XDECREF
(
tmp_value
);
Py_XDECREF
(
tmp_tb
);
Py_XDECREF
(
tmp_tb
);
...
@@ -478,6 +509,16 @@ static CYTHON_INLINE void __Pyx_ExceptionSwap(PyObject **type, PyObject **value,
...
@@ -478,6 +509,16 @@ static CYTHON_INLINE void __Pyx_ExceptionSwap(PyObject **type, PyObject **value,
#if CYTHON_FAST_THREAD_STATE
#if CYTHON_FAST_THREAD_STATE
static
CYTHON_INLINE
void
__Pyx__ExceptionSwap
(
PyThreadState
*
tstate
,
PyObject
**
type
,
PyObject
**
value
,
PyObject
**
tb
)
{
static
CYTHON_INLINE
void
__Pyx__ExceptionSwap
(
PyThreadState
*
tstate
,
PyObject
**
type
,
PyObject
**
value
,
PyObject
**
tb
)
{
PyObject
*
tmp_type
,
*
tmp_value
,
*
tmp_tb
;
PyObject
*
tmp_type
,
*
tmp_value
,
*
tmp_tb
;
#if PY_MAJOR_VERSION >= 3 && PY_MINOR_VERSION >= 7
tmp_type
=
tstate
->
exc_state
.
exc_type
;
tmp_value
=
tstate
->
exc_state
.
exc_value
;
tmp_tb
=
tstate
->
exc_state
.
exc_traceback
;
tstate
->
exc_state
.
exc_type
=
*
type
;
tstate
->
exc_state
.
exc_value
=
*
value
;
tstate
->
exc_state
.
exc_traceback
=
*
tb
;
#else
tmp_type
=
tstate
->
exc_type
;
tmp_type
=
tstate
->
exc_type
;
tmp_value
=
tstate
->
exc_value
;
tmp_value
=
tstate
->
exc_value
;
tmp_tb
=
tstate
->
exc_traceback
;
tmp_tb
=
tstate
->
exc_traceback
;
...
@@ -486,6 +527,7 @@ static CYTHON_INLINE void __Pyx__ExceptionSwap(PyThreadState *tstate, PyObject *
...
@@ -486,6 +527,7 @@ static CYTHON_INLINE void __Pyx__ExceptionSwap(PyThreadState *tstate, PyObject *
tstate
->
exc_value
=
*
value
;
tstate
->
exc_value
=
*
value
;
tstate
->
exc_traceback
=
*
tb
;
tstate
->
exc_traceback
=
*
tb
;
#endif
*
type
=
tmp_type
;
*
type
=
tmp_type
;
*
value
=
tmp_value
;
*
value
=
tmp_value
;
*
tb
=
tmp_tb
;
*
tb
=
tmp_tb
;
...
...
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