diff options
author | Jason R. Coombs <jaraco@jaraco.com> | 2016-08-04 06:46:07 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2016-08-04 06:46:07 -0400 |
commit | 07671cdc72f4cf7d729adf5d1321b718c66fb2a7 (patch) | |
tree | 3a936a996f0cbd8e64449e95b78c415b1025c9ea /setuptools/msvc.py | |
parent | aad4a6913d3e505064c76322d20756909724c411 (diff) | |
parent | 7b1fa7643e2599f24956323a2066a6e26dc57b82 (diff) | |
download | external_python_setuptools-07671cdc72f4cf7d729adf5d1321b718c66fb2a7.tar.gz external_python_setuptools-07671cdc72f4cf7d729adf5d1321b718c66fb2a7.tar.bz2 external_python_setuptools-07671cdc72f4cf7d729adf5d1321b718c66fb2a7.zip |
Merge pull request #715 from JGoutin/patch-1
#694 Patch distutils._msvccompiler.library_dir_option
Diffstat (limited to 'setuptools/msvc.py')
-rw-r--r-- | setuptools/msvc.py | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/setuptools/msvc.py b/setuptools/msvc.py index 6fb3300b..da26371c 100644 --- a/setuptools/msvc.py +++ b/setuptools/msvc.py @@ -85,6 +85,13 @@ def patch_for_specialized_compiler(): except Exception: pass + try: + # Patch distutils._msvccompiler.MSVCCompiler.library_dir_option + unpatched['msvc14_library_dir_option'] = msvc14compiler.MSVCCompiler.library_dir_option + msvc14compiler.MSVCCompiler.library_dir_option = msvc14_library_dir_option + except Exception: + pass + def msvc9_find_vcvarsall(version): """ @@ -212,6 +219,26 @@ def msvc14_get_vc_env(plat_spec): raise +def msvc14_library_dir_option(self, dir): + """ + Patched "distutils._msvccompiler.MSVCCompiler.library_dir_option" + to fix unquoted path in "\LIBPATH" argument when a space is on path. + + Parameters + ---------- + dir: str + Path to convert in "\LIBPATH" argument. + + Return + ------ + "\LIBPATH" argument: str + """ + if ' ' in dir and '"' not in dir: + # Quote if space and not already quoted + dir = '"%s"' % dir + return unpatched['msvc14_library_dir_option'](self, dir) + + def _augment_exception(exc, version, arch=''): """ Add details to the exception message to help guide the user |