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
b4b913b1
Commit
b4b913b1
authored
Jul 03, 2016
by
J. Goutin
Committed by
GitHub
Jul 03, 2016
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Update msvc.py
parent
7b929077
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
16 additions
and
6 deletions
+16
-6
setuptools/msvc.py
setuptools/msvc.py
+16
-6
No files found.
setuptools/msvc.py
View file @
b4b913b1
...
...
@@ -9,8 +9,18 @@ from setuptools.extern.six.moves import filterfalse
try
:
from
setuptools.extern.six.moves
import
winreg
safe_env
=
os
.
environ
except
ImportError
:
pass
"""
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
:
# Distutil file for MSVC++ 9.0 and upper (Python 2.7 to 3.4)
...
...
@@ -242,7 +252,7 @@ class PlatformInfo:
arch: str
Target architecture.
"""
current_cpu
=
os
.
environ
.
get
(
'processor_architecture'
,
''
).
lower
()
current_cpu
=
safe_env
.
get
(
'processor_architecture'
,
''
).
lower
()
def
__init__
(
self
,
arch
):
self
.
arch
=
arch
.
lower
().
replace
(
'x64'
,
'amd64'
)
...
...
@@ -455,9 +465,9 @@ class SystemInfo:
"""
# Variables and properties in this class use originals CamelCase variables
# names from Microsoft source files for more easy comparaison.
WinDir =
os.environ
.get('
WinDir
', '')
ProgramFiles =
os.environ
.get('
ProgramFiles
', '')
ProgramFilesx86 =
os.environ
.get('
ProgramFiles
(
x86
)
', ProgramFiles)
WinDir =
safe_env
.get('
WinDir
', '')
ProgramFiles =
safe_env
.get('
ProgramFiles
', '')
ProgramFilesx86 =
safe_env
.get('
ProgramFiles
(
x86
)
', ProgramFiles)
def __init__(self, registry_info, vc_ver=None):
self.ri = registry_info
...
...
@@ -1128,7 +1138,7 @@ class EnvironmentInfo:
"""
# flatten spec_path_lists
spec_paths = itertools.chain.from_iterable(spec_path_lists)
env_paths =
os.environ
.get(name, '').split(os.pathsep)
env_paths =
safe_env
.get(name, '').split(os.pathsep)
paths = itertools.chain(spec_paths, env_paths)
extant_paths = list(filter(os.path.isdir, paths)) if exists else paths
if not extant_paths:
...
...
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