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
ce36ba4b
Commit
ce36ba4b
authored
Jul 26, 2013
by
Robert Bradshaw
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Implement warn.all (or any_directive.all).
parent
b446c273
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
16 additions
and
3 deletions
+16
-3
Cython/Compiler/Options.py
Cython/Compiler/Options.py
+16
-3
No files found.
Cython/Compiler/Options.py
View file @
ce36ba4b
...
@@ -303,6 +303,11 @@ def parse_directive_list(s, relaxed_bool=False, ignore_unknown=False,
...
@@ -303,6 +303,11 @@ def parse_directive_list(s, relaxed_bool=False, ignore_unknown=False,
Traceback (most recent call last):
Traceback (most recent call last):
...
...
ValueError: Unknown option: "unknown"
ValueError: Unknown option: "unknown"
>>> warnings = parse_directive_list('warn.all=True')
>>> len(warnings) > 1
True
>>> sum(warnings.values()) == len(warnings) # all true.
True
"""
"""
if
current_settings
is
None
:
if
current_settings
is
None
:
result
=
{}
result
=
{}
...
@@ -313,10 +318,18 @@ def parse_directive_list(s, relaxed_bool=False, ignore_unknown=False,
...
@@ -313,10 +318,18 @@ def parse_directive_list(s, relaxed_bool=False, ignore_unknown=False,
if
not
item
:
continue
if
not
item
:
continue
if
not
'='
in
item
:
raise
ValueError
(
'Expected "=" in option "%s"'
%
item
)
if
not
'='
in
item
:
raise
ValueError
(
'Expected "=" in option "%s"'
%
item
)
name
,
value
=
[
s
.
strip
()
for
s
in
item
.
strip
().
split
(
'='
,
1
)
]
name
,
value
=
[
s
.
strip
()
for
s
in
item
.
strip
().
split
(
'='
,
1
)
]
parsed_value
=
parse_directive_value
(
name
,
value
,
relaxed_bool
=
relaxed_bool
)
if
name
not
in
directive_defaults
:
if
parsed_value
is
None
:
found
=
False
if
not
ignore_unknown
:
if
name
.
endswith
(
'.all'
):
prefix
=
name
[:
-
3
]
for
directive
in
directive_defaults
:
if
directive
.
startswith
(
prefix
):
found
=
True
parsed_value
=
parse_directive_value
(
directive
,
value
,
relaxed_bool
=
relaxed_bool
)
result
[
directive
]
=
parsed_value
if
not
found
and
not
ignore_unknown
:
raise
ValueError
(
'Unknown option: "%s"'
%
name
)
raise
ValueError
(
'Unknown option: "%s"'
%
name
)
else
:
else
:
parsed_value
=
parse_directive_value
(
name
,
value
,
relaxed_bool
=
relaxed_bool
)
result
[
name
]
=
parsed_value
result
[
name
]
=
parsed_value
return
result
return
result
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