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
Boxiang Sun
cython
Commits
7f21402d
Commit
7f21402d
authored
Dec 04, 2010
by
Robert Bradshaw
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'fatal_errors' of
https://github.com/certik/cython
parents
12b64d68
03397f1d
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
10 additions
and
0 deletions
+10
-0
Cython/Compiler/CmdLine.py
Cython/Compiler/CmdLine.py
+3
-0
Cython/Compiler/Errors.py
Cython/Compiler/Errors.py
+3
-0
Cython/Compiler/Options.py
Cython/Compiler/Options.py
+4
-0
No files found.
Cython/Compiler/CmdLine.py
View file @
7f21402d
...
...
@@ -35,6 +35,7 @@ Options:
--embed Embed the Python interpreter in a main() method.
-2 Compile based on Python-2 syntax and code semantics.
-3 Compile based on Python-3 syntax and code semantics.
--fatal-errors Abort the compilation on the first error
-X, --directive <name>=<value>[,<name=value,...] Overrides a compiler directive
"""
...
...
@@ -117,6 +118,8 @@ def parse_command_line(args):
options
.
language_level
=
2
elif
option
==
'-3'
:
options
.
language_level
=
3
elif
option
==
"--fatal-errors"
:
Options
.
fatal_errors
=
True
elif
option
in
(
"-X"
,
"--directive"
):
try
:
options
.
compiler_directives
=
Options
.
parse_directive_list
(
...
...
Cython/Compiler/Errors.py
View file @
7f21402d
...
...
@@ -5,6 +5,7 @@
import
sys
from
Cython.Utils
import
open_new_file
from
DebugFlags
import
debug_exception_on_error
import
Options
class
PyrexError
(
Exception
):
...
...
@@ -138,6 +139,8 @@ def report_error(err):
except
UnicodeEncodeError
:
echo_file
.
write
(
line
.
encode
(
'ASCII'
,
'replace'
))
num_errors
=
num_errors
+
1
if
Options
.
fatal_errors
:
sys
.
exit
(
1
)
def
error
(
position
,
message
):
#print "Errors.error:", repr(position), repr(message) ###
...
...
Cython/Compiler/Options.py
View file @
7f21402d
...
...
@@ -18,6 +18,10 @@ generate_cleanup_code = 0
annotate
=
0
# This will abort the compilation on the first error occured rather than trying
# to keep going and printing further error messages.
fatal_errors
=
False
# This will convert statements of the form "for i in range(...)"
# to "for i from ..." when i is a cdef'd integer type, and the direction
# (i.e. sign of step) can be determined.
...
...
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