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
Xavier Thompson
cython
Commits
26589357
Commit
26589357
authored
Feb 02, 2016
by
Robert Bradshaw
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #478 from eugulixes/__PYX_ERR
Hide some parts of stack trace in __PYX_ERR macro
parents
eff599d2
b6d9e27e
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
17 additions
and
4 deletions
+17
-4
Cython/Compiler/Code.py
Cython/Compiler/Code.py
+3
-2
Cython/Compiler/ModuleNode.py
Cython/Compiler/ModuleNode.py
+14
-2
No files found.
Cython/Compiler/Code.py
View file @
26589357
...
...
@@ -2145,8 +2145,9 @@ class CCodeWriter(object):
def
error_goto
(
self
,
pos
):
lbl
=
self
.
funcstate
.
error_label
self
.
funcstate
.
use_label
(
lbl
)
return
"{%s goto %s;}"
%
(
self
.
set_error_info
(
pos
),
return
"__PYX_ERR(%s, %s, %s)"
%
(
self
.
lookup_filename
(
pos
[
0
]),
pos
[
1
],
lbl
)
def
error_goto_if
(
self
,
cond
,
pos
):
...
...
Cython/Compiler/ModuleNode.py
View file @
26589357
...
...
@@ -335,7 +335,7 @@ class ModuleNode(Nodes.Node, Nodes.BlockNode):
globalstate
.
initialize_main_c_code
()
h_code
=
globalstate
[
'h_code'
]
self
.
generate_module_preamble
(
env
,
modules
,
result
.
embedded_metadata
,
h_code
)
self
.
generate_module_preamble
(
env
,
options
,
modules
,
result
.
embedded_metadata
,
h_code
)
globalstate
.
module_pos
=
self
.
pos
globalstate
.
directives
=
self
.
directives
...
...
@@ -590,7 +590,7 @@ class ModuleNode(Nodes.Node, Nodes.BlockNode):
def
_put_setup_code
(
self
,
code
,
name
):
code
.
put
(
UtilityCode
.
load_as_string
(
name
,
"ModuleSetupCode.c"
)[
1
])
def
generate_module_preamble
(
self
,
env
,
cimported_modules
,
metadata
,
code
):
def
generate_module_preamble
(
self
,
env
,
options
,
cimported_modules
,
metadata
,
code
):
code
.
put_generated_by
()
if
metadata
:
code
.
putln
(
"/* BEGIN: Cython Metadata"
)
...
...
@@ -618,6 +618,18 @@ class ModuleNode(Nodes.Node, Nodes.BlockNode):
self
.
_put_setup_code
(
code
,
"CInitCode"
)
self
.
_put_setup_code
(
code
,
"MathInitCode"
)
if
options
.
c_line_in_traceback
:
cinfo
=
"%s = %s; "
%
(
Naming
.
clineno_cname
,
Naming
.
line_c_macro
)
else
:
cinfo
=
""
code
.
put
(
"""
#define __PYX_ERR(f_index, lineno, Ln_error)
\
\
{
\
\
%s = %s[f_index]; %s = lineno; %sgoto Ln_error;
\
\
}
"""
%
(
Naming
.
filename_cname
,
Naming
.
filetable_cname
,
Naming
.
lineno_cname
,
cinfo
))
code
.
put
(
"""
#if PY_MAJOR_VERSION >= 3
#define __Pyx_PyNumber_Divide(x,y) PyNumber_TrueDivide(x,y)
...
...
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