Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
S
setuptools
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Jérome Perrin
setuptools
Commits
ac59ef12
Commit
ac59ef12
authored
Apr 07, 2017
by
Jason R. Coombs
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
extract two functions for guessing the VC version; ref #995
parent
20b3b3ea
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
25 additions
and
16 deletions
+25
-16
setuptools/msvc.py
setuptools/msvc.py
+25
-16
No files found.
setuptools/msvc.py
View file @
ac59ef12
...
...
@@ -530,22 +530,7 @@ class SystemInfo:
"""
self.VSInstallDir
# Default path starting VS2017
guess_vc = ''
if self.vc_ver > 14.0:
default = r'
VC
\
Tools
\
MSVC
'
guess_vc = os.path.join(self.VSInstallDir, default)
# Subdir with VC exact version as name
try:
vc_exact_ver = os.listdir(guess_vc)[-1]
guess_vc = os.path.join(guess_vc, vc_exact_ver)
except (OSError, IOError, IndexError):
guess_vc = ''
# Legacy default path
if not guess_vc:
default = r'
Microsoft
Visual
Studio
%
0.1
f
\
VC
' % self.vc_ver
guess_vc = os.path.join(self.ProgramFilesx86, default)
guess_vc = self._guess_vc() or self._guess_vc_legacy()
# Try to get "VC++ for Python" path from registry as default path
reg_path = os.path.join(self.ri.vc_for_python, '
%
0.1
f' % self.vc_ver)
...
...
@@ -561,6 +546,30 @@ class SystemInfo:
return path
def _guess_vc(self):
"""
Locate Visual C for 2017
"""
if self.vc_ver <= 14.0:
return
default = r'
VC
\
Tools
\
MSVC
'
guess_vc = os.path.join(self.VSInstallDir, default)
# Subdir with VC exact version as name
try:
vc_exact_ver = os.listdir(guess_vc)[-1]
return os.path.join(guess_vc, vc_exact_ver)
except (OSError, IOError, IndexError):
pass
def _guess_vc_legacy(self):
"""
Locate Visual C for versions prior to 2017
"""
default = r'
Microsoft
Visual
Studio
%
0.1
f
\
VC
' % self.vc_ver
return os.path.join(self.ProgramFilesx86, default)
@property
def WindowsSdkVersion(self):
"""
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment