summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJonathan Helmus <jjhelmus@gmail.com>2017-09-20 13:06:25 -0500
committerJonathan Helmus <jjhelmus@gmail.com>2017-09-20 15:35:48 -0500
commit3e057352d0e84c6bb14c3b38d6721b4dff8c07a1 (patch)
tree4ad89b3110a009649933aa776ea5b47cd80bcee9
parent76cabbbf3b985631212cba6b164c4bac3d2d42c2 (diff)
downloadnumpy-3e057352d0e84c6bb14c3b38d6721b4dff8c07a1.tar.gz
BUG: adjust gfortran version search regex
Adjust the gfortran regex to require a '.' to be present in the version number. This avoids matching a hash or text containing a '-' such as the version string from the compilers produced by crosstool-NG. For example: GNU Fortran (crosstool-NG 8a21ab48) 7.2.0
-rw-r--r--numpy/distutils/fcompiler/gnu.py3
-rw-r--r--numpy/distutils/tests/test_fcompiler_gnu.py3
2 files changed, 4 insertions, 2 deletions
diff --git a/numpy/distutils/fcompiler/gnu.py b/numpy/distutils/fcompiler/gnu.py
index 2260fd50d..10c60dc6f 100644
--- a/numpy/distutils/fcompiler/gnu.py
+++ b/numpy/distutils/fcompiler/gnu.py
@@ -66,7 +66,8 @@ class GnuFCompiler(FCompiler):
m = re.search(r'GNU Fortran\s+95.*?([0-9-.]+)', version_string)
if m:
return ('gfortran', m.group(1))
- m = re.search(r'GNU Fortran.*?\-?([0-9-.]+)', version_string)
+ m = re.search(
+ r'GNU Fortran.*?\-?([0-9-.]+\.[0-9-.]+)', version_string)
if m:
v = m.group(1)
if v.startswith('0') or v.startswith('2') or v.startswith('3'):
diff --git a/numpy/distutils/tests/test_fcompiler_gnu.py b/numpy/distutils/tests/test_fcompiler_gnu.py
index 9ad63cf09..659520513 100644
--- a/numpy/distutils/tests/test_fcompiler_gnu.py
+++ b/numpy/distutils/tests/test_fcompiler_gnu.py
@@ -26,7 +26,8 @@ gfortran_version_strings = [
'4.9.1'),
("gfortran: warning: couldn't understand kern.osversion '14.1.0\n"
"gfortran: warning: yet another warning\n4.9.1",
- '4.9.1')
+ '4.9.1'),
+ ('GNU Fortran (crosstool-NG 8a21ab48) 7.2.0', '7.2.0')
]
class TestG77Versions(object):