diff options
author | Joseph Brill <48932340+jcbrill@users.noreply.github.com> | 2024-10-01 13:13:46 (GMT) |
---|---|---|
committer | Joseph Brill <48932340+jcbrill@users.noreply.github.com> | 2024-10-01 13:13:46 (GMT) |
commit | 444f44c0f8caaf4508fdf31b58fd9647dca2618e (patch) | |
tree | 7f72c49d2e9b981a2e0031fb6e3b2b89dedaa339 | |
parent | 29fe1db319d04d7c371a5cc38c3677a53d47258c (diff) | |
download | SCons-444f44c0f8caaf4508fdf31b58fd9647dca2618e.zip SCons-444f44c0f8caaf4508fdf31b58fd9647dca2618e.tar.gz SCons-444f44c0f8caaf4508fdf31b58fd9647dca2618e.tar.bz2 |
Detect double quotes in SCONS_MSCOMMON_DEBUG value and raise UserError immediately.
-rw-r--r-- | SCons/Tool/MSCommon/common.py | 15 |
1 files changed, 6 insertions, 9 deletions
diff --git a/SCons/Tool/MSCommon/common.py b/SCons/Tool/MSCommon/common.py index 3663f11..eebf4c6 100644 --- a/SCons/Tool/MSCommon/common.py +++ b/SCons/Tool/MSCommon/common.py @@ -45,15 +45,12 @@ class MSCommonLogFileWarning(SCons.Warnings.WarningOnByDefault): pass def _check_logfile(logfile): - if logfile and len(logfile) >= 2: - if logfile[0] == '"' and logfile[-1] == '"': - logfile = logfile[1:-1] - warn_msg = ( - "SCONS_MSCOMMON_DEBUG value enclosed in double quotes, doubles quotes removed\n" - f' original value="{logfile}"\n' - f" modified value={logfile}" - ) - SCons.Warnings.warn(MSCommonLogFileWarning, warn_msg) + if logfile and '"' in logfile: + err_msg = ( + "SCONS_MSCOMMON_DEBUG value contains double quote character(s)\n" + f" SCONS_MSCOMMON_DEBUG={logfile}" + ) + raise SCons.Errors.UserError(err_msg) return logfile # SCONS_MSCOMMON_DEBUG is internal-use so undocumented: |