diff options
author | David Cournapeau <cournape@gmail.com> | 2009-11-19 05:07:01 (GMT) |
---|---|---|
committer | David Cournapeau <cournape@gmail.com> | 2009-11-19 05:07:01 (GMT) |
commit | c8ef6a4aaad99efea81b79dc36fc66ab7ac7bd83 (patch) | |
tree | ab6107c2a0fa0b6d138fed1ab7076c8a20138994 /src/engine/SCons/Tool/MSCommon/vc.py | |
parent | f0b70ec2d166a7a1d4dd3f5379382e9a146e7ba9 (diff) | |
download | SCons-c8ef6a4aaad99efea81b79dc36fc66ab7ac7bd83.zip SCons-c8ef6a4aaad99efea81b79dc36fc66ab7ac7bd83.tar.gz SCons-c8ef6a4aaad99efea81b79dc36fc66ab7ac7bd83.tar.bz2 |
BUG: catch any VisualCException when querying available versions through find_vc_pdir.
Diffstat (limited to 'src/engine/SCons/Tool/MSCommon/vc.py')
-rw-r--r-- | src/engine/SCons/Tool/MSCommon/vc.py | 18 |
1 files changed, 14 insertions, 4 deletions
diff --git a/src/engine/SCons/Tool/MSCommon/vc.py b/src/engine/SCons/Tool/MSCommon/vc.py index 4efa0a0..6415783 100644 --- a/src/engine/SCons/Tool/MSCommon/vc.py +++ b/src/engine/SCons/Tool/MSCommon/vc.py @@ -121,7 +121,12 @@ _VCVER_TO_PRODUCT_DIR = { def find_vc_pdir(msvc_version): """Try to find the product directory for the given - version.""" + version. + + Note + ---- + If for some reason the requested version could not be found, an + exception which inherits from VisualCException will be raised.""" root = 'Software\\' if common.is_win64(): root = root + 'Wow6432Node\\' @@ -173,9 +178,14 @@ def get_installed_vcs(): installed_versions = [] for ver in _VCVER: debug('trying to find VC %s' % ver) - if find_vc_pdir(ver): - debug('found VC %s' % ver) - installed_versions.append(ver) + try: + if find_vc_pdir(ver): + debug('found VC %s' % ver) + installed_versions.append(ver) + else: + debug('find_vc_pdir return None for ver %s' % ver) + except VisualCException, e: + debug('did not find VC %s: caught exception %s' % (ver, str(e))) return installed_versions def script_env(script, args=None): |