diff options
author | Joseph Brill <48932340+jcbrill@users.noreply.github.com> | 2022-07-07 17:41:07 (GMT) |
---|---|---|
committer | Joseph Brill <48932340+jcbrill@users.noreply.github.com> | 2022-07-07 17:41:07 (GMT) |
commit | 88c534e242abcb17c721ceffd976397cf8d4c097 (patch) | |
tree | dd8df88e5cbb83aecb21b65d44e793ba8db9085a /SCons/Tool/MSCommon | |
parent | e8faf157450ec575d743108624645bb8207c4a00 (diff) | |
download | SCons-88c534e242abcb17c721ceffd976397cf8d4c097.zip SCons-88c534e242abcb17c721ceffd976397cf8d4c097.tar.gz SCons-88c534e242abcb17c721ceffd976397cf8d4c097.tar.bz2 |
Minor update to msvc exceptions and rework new unit tests.
Diffstat (limited to 'SCons/Tool/MSCommon')
-rw-r--r-- | SCons/Tool/MSCommon/MSVC/Exceptions.py | 15 | ||||
-rw-r--r-- | SCons/Tool/MSCommon/MSVC/Policy.py | 5 | ||||
-rw-r--r-- | SCons/Tool/MSCommon/__init__.py | 1 | ||||
-rw-r--r-- | SCons/Tool/MSCommon/vc.py | 5 |
4 files changed, 17 insertions, 9 deletions
diff --git a/SCons/Tool/MSCommon/MSVC/Exceptions.py b/SCons/Tool/MSCommon/MSVC/Exceptions.py index a12b3c6..7b24a2b 100644 --- a/SCons/Tool/MSCommon/MSVC/Exceptions.py +++ b/SCons/Tool/MSCommon/MSVC/Exceptions.py @@ -25,27 +25,32 @@ Exceptions for Microsoft Visual C/C++. """ +# reminder: add exceptions to MSCommon if necessary + class VisualCException(Exception): pass class MSVCInternalError(VisualCException): pass +class MSVCUserError(VisualCException): + pass + class MSVCScriptExecutionError(VisualCException): pass -class MSVCVersionNotFound(VisualCException): +class MSVCVersionNotFound(MSVCUserError): pass -class MSVCSDKVersionNotFound(VisualCException): +class MSVCSDKVersionNotFound(MSVCUserError): pass -class MSVCToolsetVersionNotFound(VisualCException): +class MSVCToolsetVersionNotFound(MSVCUserError): pass -class MSVCSpectreLibsNotFound(VisualCException): +class MSVCSpectreLibsNotFound(MSVCUserError): pass -class MSVCArgumentError(VisualCException): +class MSVCArgumentError(MSVCUserError): pass diff --git a/SCons/Tool/MSCommon/MSVC/Policy.py b/SCons/Tool/MSCommon/MSVC/Policy.py index 9b7025e..fe8da31 100644 --- a/SCons/Tool/MSCommon/MSVC/Policy.py +++ b/SCons/Tool/MSCommon/MSVC/Policy.py @@ -45,6 +45,7 @@ from ..common import ( ) from .Exceptions import ( + MSVCArgumentError, MSVCVersionNotFound, MSVCScriptExecutionError, ) @@ -141,7 +142,7 @@ def _msvc_notfound_policy_lookup(symbol): repr(symbol), ', '.join([repr(s) for s in MSVC_NOTFOUND_POLICY_EXTERNAL.keys()]) ) - raise ValueError(err_msg) + raise MSVCArgumentError(err_msg) return notfound_policy_def @@ -225,7 +226,7 @@ def _msvc_scripterror_policy_lookup(symbol): repr(symbol), ', '.join([repr(s) for s in MSVC_SCRIPTERROR_POLICY_EXTERNAL.keys()]) ) - raise ValueError(err_msg) + raise MSVCArgumentError(err_msg) return scripterror_policy_def diff --git a/SCons/Tool/MSCommon/__init__.py b/SCons/Tool/MSCommon/__init__.py index 8396e17..0640bce 100644 --- a/SCons/Tool/MSCommon/__init__.py +++ b/SCons/Tool/MSCommon/__init__.py @@ -58,6 +58,7 @@ from .MSVC.Policy import msvc_get_scripterror_policy # noqa: F401 from .MSVC.Exceptions import VisualCException # noqa: F401 from .MSVC.Exceptions import MSVCInternalError # noqa: F401 +from .MSVC.Exceptions import MSVCUserError # noqa: F401 from .MSVC.Exceptions import MSVCScriptExecutionError # noqa: F401 from .MSVC.Exceptions import MSVCVersionNotFound # noqa: F401 from .MSVC.Exceptions import MSVCSDKVersionNotFound # noqa: F401 diff --git a/SCons/Tool/MSCommon/vc.py b/SCons/Tool/MSCommon/vc.py index 68b8f08..27a254b 100644 --- a/SCons/Tool/MSCommon/vc.py +++ b/SCons/Tool/MSCommon/vc.py @@ -64,6 +64,7 @@ from . import MSVC from .MSVC.Exceptions import ( VisualCException, + MSVCUserError, MSVCArgumentError, MSVCToolsetVersionNotFound, ) @@ -86,10 +87,10 @@ class NoVersionFound(VisualCException): class BatchFileExecutionError(VisualCException): pass -class MSVCScriptNotFound(VisualCException): +class MSVCScriptNotFound(MSVCUserError): pass -class MSVCUseSettingsError(VisualCException): +class MSVCUseSettingsError(MSVCUserError): pass |