summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEric Wieser <wieser.eric@gmail.com>2018-09-10 21:59:09 -0700
committerGitHub <noreply@github.com>2018-09-10 21:59:09 -0700
commite00a7d8489c2052e32b9997186a1e7981e5420c9 (patch)
tree05ee9b605de9fb16ed94de806c7fd13b46794982
parentf5838d072f18f252d9e69c753f991306112d06a1 (diff)
parent2f1dcd0c178a08ed30ceaf6dbf85edec94e8c3a0 (diff)
downloadnumpy-e00a7d8489c2052e32b9997186a1e7981e5420c9.tar.gz
Merge pull request #11891 from tylerjereddy/rm_exec_command_1
MAINT: remove exec_command() from build_ext
-rw-r--r--numpy/distutils/command/build_ext.py12
1 files changed, 8 insertions, 4 deletions
diff --git a/numpy/distutils/command/build_ext.py b/numpy/distutils/command/build_ext.py
index f6bd81b6c..0b8df194b 100644
--- a/numpy/distutils/command/build_ext.py
+++ b/numpy/distutils/command/build_ext.py
@@ -6,6 +6,7 @@ from __future__ import division, absolute_import, print_function
import os
import sys
import shutil
+import subprocess
from glob import glob
from distutils.dep_util import newer_group
@@ -15,7 +16,7 @@ from distutils.errors import DistutilsFileError, DistutilsSetupError,\
from distutils.file_util import copy_file
from numpy.distutils import log
-from numpy.distutils.exec_command import exec_command
+from numpy.distutils.exec_command import filepath_from_subprocess_output
from numpy.distutils.system_info import combine_paths, system_info
from numpy.distutils.misc_util import filter_sources, has_f_sources, \
has_cxx_sources, get_ext_source_files, \
@@ -558,9 +559,12 @@ class build_ext (old_build_ext):
# correct path when compiling in Cygwin but with normal Win
# Python
if dir.startswith('/usr/lib'):
- s, o = exec_command(['cygpath', '-w', dir], use_tee=False)
- if not s:
- dir = o
+ try:
+ dir = subprocess.check_output(['cygpath', '-w', dir])
+ except (OSError, subprocess.CalledProcessError):
+ pass
+ else:
+ dir = filepath_from_subprocess_output(dir)
f_lib_dirs.append(dir)
c_library_dirs.extend(f_lib_dirs)