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
28ef4014
Commit
28ef4014
authored
May 02, 2016
by
Jason R. Coombs
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Restore ability for msvc9_support to be imported on non-Windows platforms.
parent
de9e0e83
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
21 additions
and
4 deletions
+21
-4
setuptools/msvc9_support.py
setuptools/msvc9_support.py
+21
-4
No files found.
setuptools/msvc9_support.py
View file @
28ef4014
...
@@ -2,9 +2,26 @@
...
@@ -2,9 +2,26 @@
This module improve support for Microsoft Visual C++ compilers. (Windows Only)
This module improve support for Microsoft Visual C++ compilers. (Windows Only)
"""
"""
import
os
import
os
import
collections
import
itertools
import
itertools
import
distutils.errors
import
distutils.errors
from
setuptools.extern.six.moves
import
winreg
,
filterfalse
from
setuptools.extern.six.moves
import
filterfalse
try
:
from
setuptools.extern.six.moves
import
winreg
safe_env
=
os
.
environ
except
ImportError
:
"""
Mock winreg and environ so the module can be imported
on this platform.
"""
class
winreg
:
HKEY_USERS
=
None
HKEY_CURRENT_USER
=
None
HKEY_LOCAL_MACHINE
=
None
HKEY_CLASSES_ROOT
=
None
safe_env
=
collections
.
defaultdict
(
lambda
:
''
)
try
:
try
:
# Distutil file for MSVC++ 9.0 and upper (Python 2.7 to 3.4)
# Distutil file for MSVC++ 9.0 and upper (Python 2.7 to 3.4)
...
@@ -232,7 +249,7 @@ class PlatformInfo:
...
@@ -232,7 +249,7 @@ class PlatformInfo:
arch: str
arch: str
Target architecture.
Target architecture.
"""
"""
current_cpu
=
os
.
environ
[
'processor_architecture'
].
lower
()
current_cpu
=
safe_env
[
'processor_architecture'
].
lower
()
def
__init__
(
self
,
arch
):
def
__init__
(
self
,
arch
):
self
.
arch
=
arch
.
lower
().
replace
(
'x64'
,
'amd64'
)
self
.
arch
=
arch
.
lower
().
replace
(
'x64'
,
'amd64'
)
...
@@ -443,8 +460,8 @@ class SystemInfo:
...
@@ -443,8 +460,8 @@ class SystemInfo:
vcver: float
vcver: float
Required Microsoft Visual C++ version.
Required Microsoft Visual C++ version.
"""
"""
WinDir =
os.environ
['
WinDir
']
WinDir =
safe_env
['
WinDir
']
ProgramFiles =
os.environ
['
ProgramFiles
']
ProgramFiles =
safe_env
['
ProgramFiles
']
ProgramFilesx86 = os.environ.get('
ProgramFiles
(
x86
)
', ProgramFiles)
ProgramFilesx86 = os.environ.get('
ProgramFiles
(
x86
)
', ProgramFiles)
def __init__(self, registry_info, vcver=None):
def __init__(self, registry_info, vcver=None):
...
...
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