diff options
| author | Tyler Reddy <tyler.je.reddy@gmail.com> | 2018-09-10 19:54:05 -0700 |
|---|---|---|
| committer | Tyler Reddy <tyler.je.reddy@gmail.com> | 2018-09-10 19:54:05 -0700 |
| commit | 2f1dcd0c178a08ed30ceaf6dbf85edec94e8c3a0 (patch) | |
| tree | 05ee9b605de9fb16ed94de806c7fd13b46794982 /numpy/distutils | |
| parent | f5838d072f18f252d9e69c753f991306112d06a1 (diff) | |
| download | numpy-2f1dcd0c178a08ed30ceaf6dbf85edec94e8c3a0.tar.gz | |
MAINT: remove exec_command from build_ext
* the single usage of exec_command in
distutils build_ext module has been
replaced with a standard library usage
of subprocess
Diffstat (limited to 'numpy/distutils')
| -rw-r--r-- | numpy/distutils/command/build_ext.py | 12 |
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) |
