diff options
author | Joseph Brill <48932340+jcbrill@users.noreply.github.com> | 2022-03-26 11:12:22 (GMT) |
---|---|---|
committer | Joseph Brill <48932340+jcbrill@users.noreply.github.com> | 2022-03-26 11:12:22 (GMT) |
commit | 2f02b1b3f7795c69188185305a2129c6df6f8371 (patch) | |
tree | 4e24ffb2157d1ea9be3fbd5e4a7fe73b0569c622 /SCons | |
parent | 79e560344ce05808a53f50d5b5fb96c882eb23ab (diff) | |
download | SCons-2f02b1b3f7795c69188185305a2129c6df6f8371.zip SCons-2f02b1b3f7795c69188185305a2129c6df6f8371.tar.gz SCons-2f02b1b3f7795c69188185305a2129c6df6f8371.tar.bz2 |
Simply use_script and use_settings assignment code via early function exit. Update comments.
Diffstat (limited to 'SCons')
-rw-r--r-- | SCons/Tool/MSCommon/vc.py | 27 |
1 files changed, 13 insertions, 14 deletions
diff --git a/SCons/Tool/MSCommon/vc.py b/SCons/Tool/MSCommon/vc.py index 63c9cc0..fb6b82d 100644 --- a/SCons/Tool/MSCommon/vc.py +++ b/SCons/Tool/MSCommon/vc.py @@ -931,29 +931,28 @@ def get_use_script_use_settings(env): if _undefined is None: _undefined = object() - # use_script use_settings return values - # value ignore (value, None) - # undefined undefined/None (True, None) - # undefined value not None (False, value) + # use_script use_settings return values action + # value ignored (value, None) use script or bypass detection + # undefined value not None (False, value) use dictionary + # undefined undefined/None (True, None) msvc detection # None (documentation) or evaluates False (code): bypass detection - # distinguish between undefined and None or evaluates False + # need to distinguish between undefined and None use_script = env.get('MSVC_USE_SCRIPT', _undefined) + if use_script != _undefined: + # use_script defined, use_settings ignored (not type checked) + return (use_script, None) + # undefined or None: use_settings ignored use_settings = env.get('MSVC_USE_SETTINGS', None) - if use_script != _undefined: - # use_script defined, use_settings ignored (not type checked) - use_settings = None - elif use_settings is None: - # use script undefined, use_settings undefined or None - use_script = True - else: + if use_settings is not None: # use script undefined, use_settings defined and not None (type checked) - use_script = False + return (False, use_settings) - return use_script, use_settings + # use script undefined, use_settings undefined or None + return (True, None) def msvc_setup_env(env): |