summaryrefslogtreecommitdiff
path: root/numpy/distutils/fcompiler/gnu.py
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 /numpy/distutils/fcompiler/gnu.py
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
Diffstat (limited to 'numpy/distutils/fcompiler/gnu.py')
-rw-r--r--numpy/distutils/fcompiler/gnu.py3
1 files changed, 2 insertions, 1 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'):