[Python-checkins] bpo-34225: Ensure INCLUDE and LIB directories do not end with a backslash. (GH-8464)

Steve Dower webhook-mailer at python.org
Thu Jul 26 12:17:07 EDT 2018


https://github.com/python/cpython/commit/3cc505e950cee25dc7429fdf8c1787483605649e
commit: 3cc505e950cee25dc7429fdf8c1787483605649e
branch: 3.7
author: Steve Dower <steve.dower at microsoft.com>
committer: GitHub <noreply at github.com>
date: 2018-07-26T17:17:02+01:00
summary:

bpo-34225: Ensure INCLUDE and LIB directories do not end with a backslash. (GH-8464)

files:
A Misc/NEWS.d/next/Windows/2018-07-25-16-13-12.bpo-34225.ngemNL.rst
M Lib/distutils/_msvccompiler.py

diff --git a/Lib/distutils/_msvccompiler.py b/Lib/distutils/_msvccompiler.py
index c9d3c6c67120..30b3b4739851 100644
--- a/Lib/distutils/_msvccompiler.py
+++ b/Lib/distutils/_msvccompiler.py
@@ -252,11 +252,11 @@ def initialize(self, plat_name=None):
 
         for dir in vc_env.get('include', '').split(os.pathsep):
             if dir:
-                self.add_include_dir(dir)
+                self.add_include_dir(dir.rstrip(os.sep))
 
         for dir in vc_env.get('lib', '').split(os.pathsep):
             if dir:
-                self.add_library_dir(dir)
+                self.add_library_dir(dir.rstrip(os.sep))
 
         self.preprocess_options = None
         # If vcruntime_redist is available, link against it dynamically. Otherwise,
diff --git a/Misc/NEWS.d/next/Windows/2018-07-25-16-13-12.bpo-34225.ngemNL.rst b/Misc/NEWS.d/next/Windows/2018-07-25-16-13-12.bpo-34225.ngemNL.rst
new file mode 100644
index 000000000000..d29c8696307d
--- /dev/null
+++ b/Misc/NEWS.d/next/Windows/2018-07-25-16-13-12.bpo-34225.ngemNL.rst
@@ -0,0 +1 @@
+Ensure INCLUDE and LIB directories do not end with a backslash.



More information about the Python-checkins mailing list