diff options
author | Joseph Brill <48932340+jcbrill@users.noreply.github.com> | 2022-04-24 11:19:26 (GMT) |
---|---|---|
committer | Joseph Brill <48932340+jcbrill@users.noreply.github.com> | 2022-04-24 11:19:26 (GMT) |
commit | 6f68a4fc1646be9ec4b1b6c5e8fbda031d239a0b (patch) | |
tree | 2fbe5d8c1463aeef59c472c5636f9fa3e8dc1b01 /SCons/Tool | |
parent | b19e130873dbf44d4e3edb0d0cc47df12f99b865 (diff) | |
download | SCons-6f68a4fc1646be9ec4b1b6c5e8fbda031d239a0b.zip SCons-6f68a4fc1646be9ec4b1b6c5e8fbda031d239a0b.tar.gz SCons-6f68a4fc1646be9ec4b1b6c5e8fbda031d239a0b.tar.bz2 |
Simplify msvc version not found exception messages by removing impossible combinations. Update exception message formatting.
Diffstat (limited to 'SCons/Tool')
-rw-r--r-- | SCons/Tool/MSCommon/vc.py | 30 |
1 files changed, 9 insertions, 21 deletions
diff --git a/SCons/Tool/MSCommon/vc.py b/SCons/Tool/MSCommon/vc.py index cac1744..0b25ed5 100644 --- a/SCons/Tool/MSCommon/vc.py +++ b/SCons/Tool/MSCommon/vc.py @@ -920,33 +920,21 @@ def msvc_find_valid_batch_script(env, version): env['TARGET_ARCH']=req_target_platform if version_installed: - err_msg = "MSVC version {} working host/target script was not found.\n" \ - " Host = {}, Target = {}\n" \ + err_msg = "MSVC version '{}' working host/target script was not found.\n" \ + " Host = '{}', Target = '{}'\n" \ " Visual Studio C/C++ compilers may not be set correctly".format( version, host_platform, target_platform ) else: installed_vcs = get_installed_vcs(env) - if version is not None: - if not installed_vcs: - err_msg = "MSVC version {} was not found.\n" \ - " No versions of the MSVC compiler were found.\n" \ - " Visual Studio C/C++ compilers may not be set correctly".format(version) - else: - err_msg = "MSVC version {} was not found.\n" \ - " Visual Studio C/C++ compilers may not be set correctly.\n" \ - " Installed versions are: {}".format(version, installed_vcs) + if installed_vcs: + err_msg = "MSVC version '{}' was not found.\n" \ + " Visual Studio C/C++ compilers may not be set correctly.\n" \ + " Installed versions are: {}".format(version, installed_vcs) else: - # should never get here due to early exit in msvc_setup_env - if not installed_vcs: - err_msg = "MSVC default version was not found.\n" \ - " No versions of the MSVC compiler were found.\n" \ - " Visual Studio C/C++ compilers may not be set correctly" - else: - # should be impossible: version is None and len(installed_vcs) > 0 - err_msg = "MSVC default version was not found.\n" \ - " Visual Studio C/C++ compilers may not be set correctly.\n" \ - " Installed versions are: {}".format(installed_vcs) + err_msg = "MSVC version '{}' was not found.\n" \ + " No versions of the MSVC compiler were found.\n" \ + " Visual Studio C/C++ compilers may not be set correctly".format(version) raise MSVCVersionNotFound(err_msg) return d |