diff options
author | OBATA Akio <obache@outlook.com> | 2019-01-22 17:43:27 +0900 |
---|---|---|
committer | OBATA Akio <obache@outlook.com> | 2019-01-22 17:43:27 +0900 |
commit | 5aa8b84aca5fda0438c4357d7d17ae4fcc926a46 (patch) | |
tree | faeb4a18a51706fbbcef7e93f6c3f9002054f653 /numpy/distutils/fcompiler | |
parent | 3cbc11ac56054ad3ac7461e57433aefe37f2e3e4 (diff) | |
download | numpy-5aa8b84aca5fda0438c4357d7d17ae4fcc926a46.tar.gz |
BUG: fix to check before apply `shlex.split`
`shlex.split` will try to read stdin if `None` is passed,
so change to check before apply it.
see #12823
Diffstat (limited to 'numpy/distutils/fcompiler')
-rw-r--r-- | numpy/distutils/fcompiler/__init__.py | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/numpy/distutils/fcompiler/__init__.py b/numpy/distutils/fcompiler/__init__.py index 12b32832e..001dea5ec 100644 --- a/numpy/distutils/fcompiler/__init__.py +++ b/numpy/distutils/fcompiler/__init__.py @@ -466,10 +466,8 @@ class FCompiler(CCompiler): noarch = self.distutils_vars.get('noarch', noopt) debug = self.distutils_vars.get('debug', False) - f77 = shlex.split(self.command_vars.compiler_f77, - posix=(os.name == 'posix')) - f90 = shlex.split(self.command_vars.compiler_f90, - posix=(os.name == 'posix')) + f77 = self.command_vars.compiler_f77 + f90 = self.command_vars.compiler_f90 f77flags = [] f90flags = [] @@ -477,8 +475,10 @@ class FCompiler(CCompiler): fixflags = [] if f77: + f77 = shlex.split(f77, posix=(os.name == 'posix')) f77flags = self.flag_vars.f77 if f90: + f90 = shlex.split(f90, posix=(os.name == 'posix')) f90flags = self.flag_vars.f90 freeflags = self.flag_vars.free # XXX Assuming that free format is default for f90 compiler. @@ -490,8 +490,8 @@ class FCompiler(CCompiler): # environment variable has been customized by CI or a user # should perhaps eventually be more throughly tested and more # robustly handled - fix = shlex.split(fix, posix=(os.name == 'posix')) if fix: + fix = shlex.split(fix, posix=(os.name == 'posix')) fixflags = self.flag_vars.fix + f90flags oflags, aflags, dflags = [], [], [] |