summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDimitri Papadopoulos <3234522+DimitriPapadopoulos@users.noreply.github.com>2021-09-24 12:27:06 +0200
committerDimitri Papadopoulos <3234522+DimitriPapadopoulos@users.noreply.github.com>2021-09-24 13:36:32 +0200
commit5b76b21b4ba1ee7c1fc6bc184def76dd9a701bbd (patch)
treeb61f7f6421a54f1bf630f4846c9cba474a6928bd
parent0cf5bc092f801a4c004ecdb7d1061f46aaab4ff4 (diff)
downloadnumpy-5b76b21b4ba1ee7c1fc6bc184def76dd9a701bbd.tar.gz
MAINT: Fix LGTM.com warning
Constant in conditional expression or statement Testing a constant will always give the same result. This originates in 0ca82e9, back in 2005, where if scipy_distutils_version[:5]>='0.2.2': was changed into: if 1: Given how old SciPy 0.2 is, the conditional is clearly obsolete.
-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)]