summaryrefslogtreecommitdiff
path: root/numpy
diff options
context:
space:
mode:
authorCharles Harris <charlesr.harris@gmail.com>2021-09-24 09:32:27 -0600
committerGitHub <noreply@github.com>2021-09-24 09:32:27 -0600
commitc4595d2a3ee656d6405f62b3727bdefce956f607 (patch)
treee80e3e2efaf89a453cc5fad96bb1f176d9728193 /numpy
parent94dd1fae9add6e8e63a6668d8ed8f9591793c96c (diff)
parent5b76b21b4ba1ee7c1fc6bc184def76dd9a701bbd (diff)
downloadnumpy-c4595d2a3ee656d6405f62b3727bdefce956f607.tar.gz
Merge pull request #19939 from DimitriPapadopoulos/lgtm_warning_if1
MAINT: Fix LGTM.com warning: Constant in conditional expression or statement
Diffstat (limited to 'numpy')
-rwxr-xr-xnumpy/f2py/f2py2e.py45
1 files changed, 22 insertions, 23 deletions
diff --git a/numpy/f2py/f2py2e.py b/numpy/f2py/f2py2e.py
index 1256f5330..605495574 100755
--- a/numpy/f2py/f2py2e.py
+++ b/numpy/f2py/f2py2e.py
@@ -546,30 +546,29 @@ def run_compile():
fc_flags = [_m for _m in sys.argv[1:] if _reg4.match(_m)]
sys.argv = [_m for _m in sys.argv if _m not in fc_flags]
- if 1:
- del_list = []
- for s in flib_flags:
- v = '--fcompiler='
- if s[:len(v)] == v:
- from numpy.distutils import fcompiler
- fcompiler.load_all_fcompiler_classes()
- allowed_keys = list(fcompiler.fcompiler_class.keys())
- nv = ov = s[len(v):].lower()
- if ov not in allowed_keys:
- vmap = {} # XXX
- try:
- nv = vmap[ov]
- except KeyError:
- if ov not in vmap.values():
- print('Unknown vendor: "%s"' % (s[len(v):]))
- nv = ov
- i = flib_flags.index(s)
- flib_flags[i] = '--fcompiler=' + nv
- continue
- for s in del_list:
+ del_list = []
+ for s in flib_flags:
+ v = '--fcompiler='
+ if s[:len(v)] == v:
+ from numpy.distutils import fcompiler
+ fcompiler.load_all_fcompiler_classes()
+ allowed_keys = list(fcompiler.fcompiler_class.keys())
+ nv = ov = s[len(v):].lower()
+ if ov not in allowed_keys:
+ vmap = {} # XXX
+ try:
+ nv = vmap[ov]
+ except KeyError:
+ if ov not in vmap.values():
+ print('Unknown vendor: "%s"' % (s[len(v):]))
+ nv = ov
i = flib_flags.index(s)
- del flib_flags[i]
- assert len(flib_flags) <= 2, repr(flib_flags)
+ flib_flags[i] = '--fcompiler=' + nv
+ continue
+ for s in del_list:
+ i = flib_flags.index(s)
+ del flib_flags[i]
+ assert len(flib_flags) <= 2, repr(flib_flags)
_reg5 = re.compile(r'--(verbose)')
setup_flags = [_m for _m in sys.argv[1:] if _reg5.match(_m)]