Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 90e79bd

Browse files
committed
Py3k: Fix comparison when version is None.
1 parent 6603acb commit 90e79bd

1 file changed

Lines changed: 5 additions & 2 deletions

File tree

  • numpy/distutils/fcompiler

numpy/distutils/fcompiler/gnu.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
from numpy.distutils.fcompiler import FCompiler
1010
from numpy.distutils.exec_command import exec_command
1111
from numpy.distutils.misc_util import msvc_runtime_library
12+
from numpy.distutils.compat import get_exception
1213

1314
compilers = ['GnuFCompiler', 'Gnu95FCompiler']
1415

@@ -197,7 +198,8 @@ def get_flags_debug(self):
197198
return ['-g']
198199

199200
def get_flags_opt(self):
200-
if self.get_version()<='3.3.3':
201+
v = self.get_version()
202+
if v and v<='3.3.3':
201203
# With this compiler version building Fortran BLAS/LAPACK
202204
# with -O3 caused failures in lib.lapack heevr,syevr tests.
203205
opt = ['-O2']
@@ -352,6 +354,7 @@ def _can_target(cmd, arch):
352354
compiler = Gnu95FCompiler()
353355
compiler.customize()
354356
print(compiler.get_version())
355-
except Exception, msg:
357+
except Exception:
358+
msg = get_exception()
356359
print(msg)
357360
raw_input('Press ENTER to continue...')

0 commit comments

Comments
 (0)