summaryrefslogtreecommitdiff
path: root/numpy/distutils/fcompiler/gnu.py
diff options
context:
space:
mode:
authorMichael Osthege <m.osthege@fz-juelich.de>2022-07-09 18:40:02 +0200
committerMichael Osthege <michael.osthege@outlook.com>2022-07-09 20:18:41 +0200
commit05927a66a778a8a58ac794e0239d076acb30a6a3 (patch)
tree800e1eee4f4e33d6f47900c65d8ffbb14f1f4006 /numpy/distutils/fcompiler/gnu.py
parentb89a1d219d493d62f0253b8f276b84cb61ed044a (diff)
downloadnumpy-05927a66a778a8a58ac794e0239d076acb30a6a3.tar.gz
BUG: Use `Popen` to silently invoke f77 -v
The output analyzed by this function unexpectedly ended up in stderr. Closes #21942
Diffstat (limited to 'numpy/distutils/fcompiler/gnu.py')
-rw-r--r--numpy/distutils/fcompiler/gnu.py8
1 files changed, 7 insertions, 1 deletions
diff --git a/numpy/distutils/fcompiler/gnu.py b/numpy/distutils/fcompiler/gnu.py
index d8143328e..cdb6aef94 100644
--- a/numpy/distutils/fcompiler/gnu.py
+++ b/numpy/distutils/fcompiler/gnu.py
@@ -382,7 +382,13 @@ class Gnu95FCompiler(GnuFCompiler):
def get_target(self):
try:
- output = subprocess.check_output(self.compiler_f77 + ['-v'])
+ p = subprocess.Popen(
+ self.compiler_f77 + ['-v'],
+ stdin=subprocess.PIPE,
+ stderr=subprocess.PIPE,
+ )
+ stdout, stderr = p.communicate()
+ output = (stdout or b"") + (stderr or b"")
except (OSError, subprocess.CalledProcessError):
pass
else: