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
859a62a6
Commit
859a62a6
authored
Aug 04, 2016
by
Jason R. Coombs
Committed by
GitHub
Aug 04, 2016
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #716 from JGoutin/patch-2
#707 MSVC patch and Python 2
parents
07671cdc
3ebd9363
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
39 additions
and
30 deletions
+39
-30
setuptools/msvc.py
setuptools/msvc.py
+39
-28
setuptools/tests/test_msvc.py
setuptools/tests/test_msvc.py
+0
-2
No files found.
setuptools/msvc.py
View file @
859a62a6
...
...
@@ -383,23 +383,12 @@ class RegistryInfo:
def __init__(self, platform_info):
self.pi = platform_info
@property
def microsoft(self):
"""
Microsoft software registry key.
"""
return os.path.join(
'
Software
',
'' if self.pi.current_is_x86() else '
Wow6432Node
',
'
Microsoft
',
)
@property
def visualstudio(self):
"""
Microsoft Visual Studio root registry key.
"""
return
os.path.join(self.microsoft, '
VisualStudio
')
return
'
VisualStudio
'
@property
def sxs(self):
...
...
@@ -427,15 +416,14 @@ class RegistryInfo:
"""
Microsoft Visual C++ for Python registry key.
"""
path = r'
DevDiv
\
VCForPython
'
return os.path.join(self.microsoft, path)
return r'
DevDiv
\
VCForPython
'
@property
def microsoft_sdk(self):
"""
Microsoft SDK registry key.
"""
return
os.path.join(self.microsoft, '
Microsoft
SDKs
')
return
'
Microsoft
SDKs
'
@property
def windows_sdk(self):
...
...
@@ -456,11 +444,29 @@ class RegistryInfo:
"""
Microsoft Windows Kits Roots registry key.
"""
return os.path.join(self.microsoft, r'
Windows
Kits
\
Installed
Roots
')
return r'
Windows
Kits
\
Installed
Roots
'
def microsoft(self, key, x86=False):
"""
Return key in Microsoft software registry.
Parameters
----------
key: str
Registry key path where look.
x86: str
Force x86 software registry.
Return
------
str: value
"""
node64 = '' if self.pi.current_is_x86() or x86 else r'
\
Wow6432Node
'
return os.path.join('
Software
', node64, '
Microsoft
', key)
def lookup(self, key, name):
"""
Look for values in registry.
Look for values in registry
in Microsoft software registry
.
Parameters
----------
...
...
@@ -473,18 +479,23 @@ class RegistryInfo:
------
str: value
"""
KEY_READ = winreg.KEY_READ
openkey = winreg.OpenKey
ms = self.microsoft
for hkey in self.HKEYS:
try:
bkey = winreg.OpenKey(hkey, key, 0, winreg.KEY_READ)
except OSError:
continue
except IOError:
continue
bkey = openkey(hkey, ms(key), 0, KEY_READ)
except (OSError, IOError):
if not self.pi.current_is_x86():
try:
bkey = openkey(hkey, ms(key, True), 0, KEY_READ)
except (OSError, IOError):
continue
else:
continue
try:
return winreg.QueryValueEx(bkey, name)[0]
except OSError:
pass
except IOError:
except (OSError, IOError):
pass
...
...
@@ -527,7 +538,7 @@ class SystemInfo:
for key in vckeys:
try:
bkey = winreg.OpenKey(hkey, key, 0, winreg.KEY_READ)
except
IOError
:
except
(OSError, IOError)
:
continue
subkeys, values, _ = winreg.QueryInfoKey(bkey)
for i in range(values):
...
...
@@ -840,7 +851,7 @@ class EnvironmentInfo:
Microsoft Visual C++ & Microsoft Foundation Class Includes
"""
return [os.path.join(self.si.VCInstallDir, '
Include
'),
os.path.join(self.si.VCInstallDir, '
ATLMFC
\
Include
')]
os.path.join(self.si.VCInstallDir,
r
'
ATLMFC
\
Include
')]
@property
def VCLibraries(self):
...
...
@@ -1226,5 +1237,5 @@ class EnvironmentInfo:
if name:
return '
%
s
\\
' % name[0]
return ''
except
IOError
:
except
(OSError, IOError)
:
return ''
setuptools/tests/test_msvc.py
View file @
859a62a6
...
...
@@ -73,8 +73,6 @@ class TestModulePatch:
mod_name
=
distutils
.
msvc9compiler
.
find_vcvarsall
.
__module__
assert
mod_name
==
"setuptools.msvc"
,
"find_vcvarsall unpatched"
@
pytest
.
mark
.
xfail
(
six
.
PY2
,
reason
=
"https://github.com/pypa/setuptools/issues/707"
)
def
test_no_registry_entries_means_nothing_found
(
self
):
"""
No registry entries or environment variable should lead to an error
...
...
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