diff options
author | Jason R. Coombs <jaraco@jaraco.com> | 2017-04-07 22:30:49 -0400 |
---|---|---|
committer | Jason R. Coombs <jaraco@jaraco.com> | 2017-04-07 22:30:49 -0400 |
commit | f357a32fdc9ce8e6a862efcbb9a0229f6f0a685c (patch) | |
tree | 53edbbb07758e2c00f285aa41684d4dcb5bfb5bf /setuptools/msvc.py | |
parent | 3fa9efcbb390b87304ddc64551e9fca823694773 (diff) | |
download | external_python_setuptools-f357a32fdc9ce8e6a862efcbb9a0229f6f0a685c.tar.gz external_python_setuptools-f357a32fdc9ce8e6a862efcbb9a0229f6f0a685c.tar.bz2 external_python_setuptools-f357a32fdc9ce8e6a862efcbb9a0229f6f0a685c.zip |
Simplify _get_content_dirname by simply removing the trailing backslash. Ref #995.
Diffstat (limited to 'setuptools/msvc.py')
-rw-r--r-- | setuptools/msvc.py | 11 |
1 files changed, 3 insertions, 8 deletions
diff --git a/setuptools/msvc.py b/setuptools/msvc.py index c5a8aea0..9a911834 100644 --- a/setuptools/msvc.py +++ b/setuptools/msvc.py @@ -1010,7 +1010,7 @@ class EnvironmentInfo: elif self.vc_ver >= 15.0: path = os.path.join(self.si.WindowsSdkDir, 'Bin') arch_subdir = self.pi.current_dir(x64=True) - sdkver = self._get_content_dirname(path, slash=False) + sdkver = self._get_content_dirname(path).rstrip('\\') yield os.path.join(path, r'%s%s' % (sdkver, arch_subdir)) if self.si.WindowsSDKExecutablePath: @@ -1243,7 +1243,7 @@ class EnvironmentInfo: seen_add(k) yield element - def _get_content_dirname(self, path, slash=True): + def _get_content_dirname(self, path): """ Return name of the first dir in path or '' if no dir found. @@ -1251,8 +1251,6 @@ class EnvironmentInfo: ---------- path: str Path where search dir. - slash: bool - If not True, only return "name" not "name\" Return ------ @@ -1262,10 +1260,7 @@ class EnvironmentInfo: try: name = os.listdir(path) if name: - name = name[0] - if slash: - return '%s\\' % name - return name + return '%s\\' % name[0] return '' except (OSError, IOError): return '' |