Skip to content

Subst cleanups - #4869

Merged
bdbaddog merged 1 commit into
SCons:masterfrom
mwichmann:maint/more-subst-1
Jul 6, 2026
Merged

bdbaddog merged 1 commit into
SCons:masterfrom
mwichmann:maint/more-subst-1

Conversation

@mwichmann

Copy link
Copy Markdown
Collaborator
  • Line breaks added for clarity
  • Code-style enforced in some places
  • In SpecialAttrWrapper.escape, an attribute is read once and stored in a local variable.
  • If all previous parts of an if-else chain have done return (or raise), there's no need for the next to be an "else". This causes one fairly large indentation change in StringSubber.expand(), as about 40 lines shift left one indent (checker observation)
  • In subst-dict the local variable is renamed from dict to substitutions to avoid "hiding" built-in dict (frequent checker grumble)

No changed behavior, so existing tests and docs are unchanged.

Contributor Checklist:

  • I have created a new test or updated the unit tests to cover the new/changed functionality.
  • I have updated CHANGES.txt and RELEASE.txt (and read the README.rst).
  • I have updated the appropriate documentation

@mwichmann mwichmann added the subst Problems with quoting, substitution label Jun 27, 2026
* Line breaks added for clarity
* Code-style enforced in some places
* In SpecialAttrWrapper.escape, an attribute is read once and stored
  in a local variable.
* If all previous parts of an if-else chain have done return (or raise),
  there's no need for the next to be an "else". This causes one fairly
  large indentation change in StringSubber.expand(), as about 40 lines
  shift left one indent (checker observation)
* In subst-dict the local variable is renamed from dict to substitutions
  to avoid "hiding" built-in dict (frequent checker grumble)

Signed-off-by: Mats Wichmann <[email protected]>
@mwichmann
mwichmann force-pushed the maint/more-subst-1 branch from 5db12e9 to c59efbf Compare June 27, 2026 16:03
Comment thread SCons/Subst.py Resolved
@bdbaddog
bdbaddog merged commit e24a1c3 into SCons:master Jul 6, 2026
8 of 11 checks passed
@mwichmann mwichmann added this to 4.11 Jul 6, 2026
@github-project-automation github-project-automation Bot moved this to Done in 4.11 Jul 6, 2026
@mwichmann mwichmann added this to the 4.11.0 milestone Jul 6, 2026
@mwichmann
mwichmann deleted the maint/more-subst-1 branch July 6, 2026 12:20
@mwichmann mwichmann mentioned this pull request Jul 6, 2026
3 tasks done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

subst Problems with quoting, substitution

Projects

No open projects
Status: Done

Development

Successfully merging this pull request may close these issues.

2 participants