summaryrefslogtreecommitdiffstats
path: root/Lib/distutils/msvccompiler.py
diff options
context:
space:
mode:
authorGreg Ward <gward@python.net>2000-02-11 02:52:39 (GMT)
committerGreg Ward <gward@python.net>2000-02-11 02:52:39 (GMT)
commit5de8cee73f0d6dad6ed1bcf5521dc68775cfe4b8 (patch)
treec2c3750edcc863b59113330f4a9e9b04f5f79013 /Lib/distutils/msvccompiler.py
parent699880931e52bf7d77326f3308151b37cee42dfe (diff)
downloadcpython-5de8cee73f0d6dad6ed1bcf5521dc68775cfe4b8.zip
cpython-5de8cee73f0d6dad6ed1bcf5521dc68775cfe4b8.tar.gz
cpython-5de8cee73f0d6dad6ed1bcf5521dc68775cfe4b8.tar.bz2
Ditched '_find_SET()', since it was a no-value-added wrapper around
'get_msvc_paths()'. Renamed '_do_SET()' to 'set_path_env_var()', tweaked docstring, and cosmetically tweaked code. Stylistic changes to MSVCCompiler constructor (variable renaming and type consistency).
Diffstat (limited to 'Lib/distutils/msvccompiler.py')
-rw-r--r--Lib/distutils/msvccompiler.py37
1 files changed, 14 insertions, 23 deletions
diff --git a/Lib/distutils/msvccompiler.py b/Lib/distutils/msvccompiler.py
index 3073aae..e489c1c 100644
--- a/Lib/distutils/msvccompiler.py
+++ b/Lib/distutils/msvccompiler.py
@@ -121,23 +121,14 @@ def find_exe (exe, version_number):
return exe # last desperate hope
-def _find_SET(name,version_number):
- """looks up in the registry and returns a list of values suitable for
- use in a SET command eg SET name=value. Normally the value will be a
- ';' separated list similar to a path list.
+def set_path_env_var (name, version_number):
+ """Set environment variable 'name' to an MSVC path type value obtained
+ from 'get_msvc_paths()'. This is equivalent to a SET command prior
+ to execution of spawned commands."""
- name is the name of an MSVC path and version_number is a version_number
- of an MSVC installation."""
- return get_msvc_paths(name, version_number)
-
-
-def _do_SET(name, version_number):
- """sets os.environ[name] to an MSVC path type value obtained from
- _find_SET. This is equivalent to a SET command prior to execution of
- spawned commands."""
- p=_find_SET(name, version_number)
+ p = get_msvc_paths (name, version_number)
if p:
- os.environ[name]=string.join(p,';')
+ os.environ[name] = string.join (p,';')
class MSVCCompiler (CCompiler) :
@@ -155,16 +146,16 @@ class MSVCCompiler (CCompiler) :
self.add_library_dir( os.path.join( sys.exec_prefix, 'libs' ) )
- vNum = get_devstudio_versions ()
+ versions = get_devstudio_versions ()
- if vNum:
- vNum = vNum[0] # highest version
+ if versions:
+ version = versions[0] # highest version
- self.cc = _find_exe("cl.exe", vNum)
- self.link = _find_exe("link.exe", vNum)
- _do_SET('lib', vNum)
- _do_SET('include', vNum)
- path=_find_SET('path', vNum)
+ self.cc = _find_exe("cl.exe", version)
+ self.link = _find_exe("link.exe", version)
+ set_path_env_var ('lib', version)
+ set_path_env_var ('include', version)
+ path=get_msvc_paths('path', version)
try:
for p in string.split(os.environ['path'],';'):
path.append(p)