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
Kirill Smelkov
cython
Commits
25b65f76
Commit
25b65f76
authored
Jan 07, 2014
by
Robert Bradshaw
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Traceback on unraisable exceptions.
parent
b65f48f9
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
15 additions
and
7 deletions
+15
-7
Cython/Compiler/Code.py
Cython/Compiler/Code.py
+6
-5
Cython/Compiler/Options.py
Cython/Compiler/Options.py
+1
-0
Cython/Utility/Exceptions.c
Cython/Utility/Exceptions.c
+8
-2
No files found.
Cython/Compiler/Code.py
View file @
25b65f76
...
@@ -79,17 +79,17 @@ class UtilityCodeBase(object):
...
@@ -79,17 +79,17 @@ class UtilityCodeBase(object):
Code sections in the file can be specified as follows:
Code sections in the file can be specified as follows:
##### MyUtility.proto #####
##### MyUtility.proto #####
[proto declarations]
[proto declarations]
##### MyUtility.init #####
##### MyUtility.init #####
[code run at module initialization]
[code run at module initialization]
##### MyUtility #####
##### MyUtility #####
#@requires: MyOtherUtility
#@requires: MyOtherUtility
#@substitute: naming
#@substitute: naming
[definitions]
[definitions]
for prototypes and implementation respectively. For non-python or
for prototypes and implementation respectively. For non-python or
...
@@ -2077,9 +2077,10 @@ class CCodeWriter(object):
...
@@ -2077,9 +2077,10 @@ class CCodeWriter(object):
Naming
.
clineno_cname
,
Naming
.
clineno_cname
,
Naming
.
lineno_cname
,
Naming
.
lineno_cname
,
Naming
.
filename_cname
,
Naming
.
filename_cname
,
int
(
self
.
globalstate
.
directives
[
'unraisable_tracebacks'
])
)
)
self
.
funcstate
.
uses_error_indicator
=
True
self
.
funcstate
.
uses_error_indicator
=
True
self
.
putln
(
'__Pyx_WriteUnraisable("%s", %s, %s, %s);'
%
format_tuple
)
self
.
putln
(
'__Pyx_WriteUnraisable("%s", %s, %s, %s
, %s
);'
%
format_tuple
)
self
.
globalstate
.
use_utility_code
(
self
.
globalstate
.
use_utility_code
(
UtilityCode
.
load_cached
(
"WriteUnraisableException"
,
"Exceptions.c"
))
UtilityCode
.
load_cached
(
"WriteUnraisableException"
,
"Exceptions.c"
))
...
...
Cython/Compiler/Options.py
View file @
25b65f76
...
@@ -112,6 +112,7 @@ directive_defaults = {
...
@@ -112,6 +112,7 @@ directive_defaults = {
'c_string_type'
:
'bytes'
,
'c_string_type'
:
'bytes'
,
'c_string_encoding'
:
''
,
'c_string_encoding'
:
''
,
'type_version_tag'
:
True
,
# enables Py_TPFLAGS_HAVE_VERSION_TAG on extension types
'type_version_tag'
:
True
,
# enables Py_TPFLAGS_HAVE_VERSION_TAG on extension types
'unraisable_tracebacks'
:
False
,
# set __file__ and/or __path__ to known source/target path at import time (instead of not having them available)
# set __file__ and/or __path__ to known source/target path at import time (instead of not having them available)
'set_initial_path'
:
None
,
# SOURCEFILE or "/full/path/to/module"
'set_initial_path'
:
None
,
# SOURCEFILE or "/full/path/to/module"
...
...
Cython/Utility/Exceptions.c
View file @
25b65f76
...
@@ -417,16 +417,22 @@ static CYTHON_INLINE void __Pyx_ExceptionSwap(PyObject **type, PyObject **value,
...
@@ -417,16 +417,22 @@ static CYTHON_INLINE void __Pyx_ExceptionSwap(PyObject **type, PyObject **value,
/////////////// WriteUnraisableException.proto ///////////////
/////////////// WriteUnraisableException.proto ///////////////
static
void
__Pyx_WriteUnraisable
(
const
char
*
name
,
int
clineno
,
static
void
__Pyx_WriteUnraisable
(
const
char
*
name
,
int
clineno
,
int
lineno
,
const
char
*
filename
);
/*proto*/
int
lineno
,
const
char
*
filename
,
int
full_traceback
);
/*proto*/
/////////////// WriteUnraisableException ///////////////
/////////////// WriteUnraisableException ///////////////
//@requires: PyErrFetchRestore
//@requires: PyErrFetchRestore
static
void
__Pyx_WriteUnraisable
(
const
char
*
name
,
CYTHON_UNUSED
int
clineno
,
static
void
__Pyx_WriteUnraisable
(
const
char
*
name
,
CYTHON_UNUSED
int
clineno
,
CYTHON_UNUSED
int
lineno
,
CYTHON_UNUSED
const
char
*
filename
)
{
CYTHON_UNUSED
int
lineno
,
CYTHON_UNUSED
const
char
*
filename
,
int
full_traceback
)
{
PyObject
*
old_exc
,
*
old_val
,
*
old_tb
;
PyObject
*
old_exc
,
*
old_val
,
*
old_tb
;
PyObject
*
ctx
;
PyObject
*
ctx
;
__Pyx_ErrFetch
(
&
old_exc
,
&
old_val
,
&
old_tb
);
__Pyx_ErrFetch
(
&
old_exc
,
&
old_val
,
&
old_tb
);
if
(
full_traceback
)
{
__Pyx_ErrRestore
(
old_exc
,
old_val
,
old_tb
);
PyErr_PrintEx
(
1
);
}
#if PY_MAJOR_VERSION < 3
#if PY_MAJOR_VERSION < 3
ctx
=
PyString_FromString
(
name
);
ctx
=
PyString_FromString
(
name
);
#else
#else
...
...
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