Commit c74ba60f authored by Jerome Kieffer's avatar Jerome Kieffer

PEP8: correct indentation

parent d4a30775
...@@ -4,6 +4,7 @@ ...@@ -4,6 +4,7 @@
from __future__ import absolute_import from __future__ import absolute_import
class ShouldBeFromDirective(object): class ShouldBeFromDirective(object):
known_directives = [] known_directives = []
...@@ -120,21 +121,21 @@ closure_freelist_size = 8 ...@@ -120,21 +121,21 @@ closure_freelist_size = 8
def get_directive_defaults(): def get_directive_defaults():
# To add an item to this list, all accesses should be changed to use the new # To add an item to this list, all accesses should be changed to use the new
# directive, and the global option itself should be set to an instance of # directive, and the global option itself should be set to an instance of
# ShouldBeFromDirective. # ShouldBeFromDirective.
for old_option in ShouldBeFromDirective.known_directives: for old_option in ShouldBeFromDirective.known_directives:
value = globals().get(old_option.options_name) value = globals().get(old_option.options_name)
assert old_option.directive_name in _directive_defaults assert old_option.directive_name in _directive_defaults
if not isinstance(value, ShouldBeFromDirective): if not isinstance(value, ShouldBeFromDirective):
if old_option.disallow: if old_option.disallow:
raise RuntimeError( raise RuntimeError(
"Option '%s' must be set from directive '%s'" % ( "Option '%s' must be set from directive '%s'" % (
old_option.option_name, old_option.directive_name)) old_option.option_name, old_option.directive_name))
else: else:
# Warn? # Warn?
_directive_defaults[old_option.directive_name] = value _directive_defaults[old_option.directive_name] = value
return _directive_defaults return _directive_defaults
# Declare compiler directives # Declare compiler directives
_directive_defaults = { _directive_defaults = {
...@@ -486,16 +487,16 @@ def parse_compile_time_env(s, current_settings=None): ...@@ -486,16 +487,16 @@ def parse_compile_time_env(s, current_settings=None):
>>> parse_compile_time_env(' ') >>> parse_compile_time_env(' ')
{} {}
>>> (parse_compile_time_env('boundscheck=True') == >>> (parse_compile_time_env('HAVE_OPENMP=True') ==
... {'boundscheck': True}) ... {'HAVE_OPENMP': True})
True True
>>> parse_compile_time_env(' asdf') >>> parse_compile_time_env(' asdf')
Traceback (most recent call last): Traceback (most recent call last):
... ...
ValueError: Expected "=" in option "asdf" ValueError: Expected "=" in option "asdf"
>>> parse_compile_time_env('boundscheck=hey') == {'boundscheck': 'hey'} >>> parse_compile_time_env('NUM_THREADS=4') == {'NUM_THREADS': 4}
True True
>>> parse_compile_time_env('unknown=True') == {'unknown': True} >>> parse_compile_time_env('unknown=anything') == {'unknown': 'anything'}
True True
""" """
if current_settings is None: if current_settings is None:
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment