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
934d6707
Commit
934d6707
authored
Apr 07, 2017
by
Jason R. Coombs
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Extract method for finding .Net in the framework folder. Ref #995.
parent
ac59ef12
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
15 additions
and
11 deletions
+15
-11
setuptools/msvc.py
setuptools/msvc.py
+15
-11
No files found.
setuptools/msvc.py
View file @
934d6707
...
...
@@ -753,17 +753,9 @@ class SystemInfo:
Platform number of bits: 32 or 64.
"""
# Find actual .NET version in registry
ver
=
self
.
ri
.
lookup
(
self
.
ri
.
vc
,
'frameworkver%d'
%
bits
)
or
''
# If nothing in registry, look in Framework folder
if
not
ver
:
dot_net_dir
=
(
self
.
FrameworkDir32
if
bits
==
32
else
self
.
FrameworkDir64
)
for
dir_name
in
reversed
(
os
.
listdir
(
dot_net_dir
)):
if
(
os
.
path
.
isdir
(
os
.
path
.
join
(
dot_net_dir
,
dir_name
))
and
dir_name
.
startswith
(
'v'
)):
ver
=
dir_name
break
reg_ver
=
self
.
ri
.
lookup
(
self
.
ri
.
vc
,
'frameworkver%d'
%
bits
)
dot_net_dir
=
getattr
(
self
,
'FrameworkDir%d'
%
bits
)
ver
=
reg_ver
or
self
.
_find_dot_net_in
(
dot_net_dir
)
or
''
# Set .NET versions for specified MSVC++ version
if
self
.
vc_ver
>=
12.0
:
...
...
@@ -777,6 +769,18 @@ class SystemInfo:
frameworkver
=
(
'v3.0'
,
'v2.0.50727'
)
return
frameworkver
def
_find_dot_net_in
(
self
,
dot_net_dir
):
"""
Find .Net in the Framework folder
"""
matching_dirs
=
(
dir_name
for
dir_name
in
reversed
(
os
.
listdir
(
dot_net_dir
))
if
os
.
path
.
isdir
(
os
.
path
.
join
(
dot_net_dir
,
dir_name
))
and
dir_name
.
startswith
(
'v'
)
)
return
next
(
matching_dirs
,
None
)
class
EnvironmentInfo
:
"""
...
...
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