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
b6d9e27e
Commit
b6d9e27e
authored
Jan 02, 2016
by
Evgeny Golyshev
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Hide some parts of stack trace in __PYX_ERR macro
parent
fbcf496e
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 @
b6d9e27e
...
@@ -2145,8 +2145,9 @@ class CCodeWriter(object):
...
@@ -2145,8 +2145,9 @@ class CCodeWriter(object):
def
error_goto
(
self
,
pos
):
def
error_goto
(
self
,
pos
):
lbl
=
self
.
funcstate
.
error_label
lbl
=
self
.
funcstate
.
error_label
self
.
funcstate
.
use_label
(
lbl
)
self
.
funcstate
.
use_label
(
lbl
)
return
"{%s goto %s;}"
%
(
return
"__PYX_ERR(%s, %s, %s)"
%
(
self
.
set_error_info
(
pos
),
self
.
lookup_filename
(
pos
[
0
]),
pos
[
1
],
lbl
)
lbl
)
def
error_goto_if
(
self
,
cond
,
pos
):
def
error_goto_if
(
self
,
cond
,
pos
):
...
...
Cython/Compiler/ModuleNode.py
View file @
b6d9e27e
...
@@ -327,7 +327,7 @@ class ModuleNode(Nodes.Node, Nodes.BlockNode):
...
@@ -327,7 +327,7 @@ class ModuleNode(Nodes.Node, Nodes.BlockNode):
globalstate
.
initialize_main_c_code
()
globalstate
.
initialize_main_c_code
()
h_code
=
globalstate
[
'h_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
.
module_pos
=
self
.
pos
globalstate
.
directives
=
self
.
directives
globalstate
.
directives
=
self
.
directives
...
@@ -582,7 +582,7 @@ class ModuleNode(Nodes.Node, Nodes.BlockNode):
...
@@ -582,7 +582,7 @@ class ModuleNode(Nodes.Node, Nodes.BlockNode):
def
_put_setup_code
(
self
,
code
,
name
):
def
_put_setup_code
(
self
,
code
,
name
):
code
.
put
(
UtilityCode
.
load_as_string
(
name
,
"ModuleSetupCode.c"
)[
1
])
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
()
code
.
put_generated_by
()
if
metadata
:
if
metadata
:
code
.
putln
(
"/* BEGIN: Cython Metadata"
)
code
.
putln
(
"/* BEGIN: Cython Metadata"
)
...
@@ -610,6 +610,18 @@ class ModuleNode(Nodes.Node, Nodes.BlockNode):
...
@@ -610,6 +610,18 @@ class ModuleNode(Nodes.Node, Nodes.BlockNode):
self
.
_put_setup_code
(
code
,
"CInitCode"
)
self
.
_put_setup_code
(
code
,
"CInitCode"
)
self
.
_put_setup_code
(
code
,
"MathInitCode"
)
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
(
"""
code
.
put
(
"""
#if PY_MAJOR_VERSION >= 3
#if PY_MAJOR_VERSION >= 3
#define __Pyx_PyNumber_Divide(x,y) PyNumber_TrueDivide(x,y)
#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