Skip to content

Commit

Permalink
BUG: Do not double-quote arguments to the command line
Browse files Browse the repository at this point in the history
After the recent patch to CCompiler.spawn, the file-paths no longer need manual quoting - that's handled as needed within subprocess.

Fixes numpy#12411
  • Loading branch information
eric-wieser committed Nov 19, 2018
1 parent 1466e78 commit 87d0528
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions numpy/distutils/ccompiler.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
from numpy.distutils.compat import get_exception
from numpy.distutils.exec_command import filepath_from_subprocess_output
from numpy.distutils.misc_util import cyg2win32, is_sequence, mingw32, \
quote_args, get_num_build_jobs, \
get_num_build_jobs, \
_commandline_dep_string

# globals for parallel build management
Expand Down Expand Up @@ -772,8 +772,13 @@ def new_compiler (plat=None,

_distutils_gen_lib_options = gen_lib_options
def gen_lib_options(compiler, library_dirs, runtime_library_dirs, libraries):
library_dirs = quote_args(library_dirs)
runtime_library_dirs = quote_args(runtime_library_dirs)
# the version of this function provided by CPython allows the following
# to return lists, which are unpacked automatically:
# - compiler.runtime_library_dir_option
# our version extends the behavior to:
# - compiler.library_dir_option
# - compiler.library_option
# - compiler.find_library_file
r = _distutils_gen_lib_options(compiler, library_dirs,
runtime_library_dirs, libraries)
lib_opts = []
Expand All @@ -793,11 +798,6 @@ def gen_lib_options(compiler, library_dirs, runtime_library_dirs, libraries):
if _m is not None:
setattr(_m, 'gen_lib_options', gen_lib_options)

_distutils_gen_preprocess_options = gen_preprocess_options
def gen_preprocess_options (macros, include_dirs):
include_dirs = quote_args(include_dirs)
return _distutils_gen_preprocess_options(macros, include_dirs)
ccompiler.gen_preprocess_options = gen_preprocess_options

##Fix distutils.util.split_quoted:
# NOTE: I removed this fix in revision 4481 (see ticket #619), but it appears
Expand Down

0 comments on commit 87d0528

Please sign in to comment.