diff options
author | E. Madison Bray <erik.bray@lri.fr> | 2020-05-13 12:47:54 +0200 |
---|---|---|
committer | E. Madison Bray <erik.bray@lri.fr> | 2020-05-13 12:47:54 +0200 |
commit | fd89e950701206122c358bba1bf816a8bcbea844 (patch) | |
tree | b377d2dbdebc354a78f18b6cc2923ba3bd61c5bb /numpy | |
parent | 9fa7fee0ad8d23bd36ef51b0ec02cf2811f1eec6 (diff) | |
download | numpy-fd89e950701206122c358bba1bf816a8bcbea844.tar.gz |
defaults for stdout and stderr should be bytes
only print stdout if no OSError exception was raised
Diffstat (limited to 'numpy')
-rw-r--r-- | numpy/f2py/__init__.py | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/numpy/f2py/__init__.py b/numpy/f2py/__init__.py index 007ed5d89..6491e445f 100644 --- a/numpy/f2py/__init__.py +++ b/numpy/f2py/__init__.py @@ -109,9 +109,10 @@ def compile(source, stderr=subprocess.PIPE) except OSError: # preserve historic status code used by exec_command() - cp = subprocess.CompletedProcess(c, 127, stdout='', stderr='') - if verbose: - print(cp.stdout.decode()) + cp = subprocess.CompletedProcess(c, 127, stdout=b'', stderr=b'') + else: + if verbose: + print(cp.stdout.decode()) finally: if source_fn is None: os.remove(fname) |