diff options
author | Mathew Robinson <mathew@chasinglogic.io> | 2020-01-06 22:42:41 (GMT) |
---|---|---|
committer | Mathew Robinson <mathew@chasinglogic.io> | 2020-01-06 22:44:49 (GMT) |
commit | 2ff7ea17b28e6962c48238550d77ec9cdd96c02c (patch) | |
tree | 515e5f35a1323f1567a3f91f2b0dc347f06e5203 /src | |
parent | 9ac66132c5189274c130182d1bc2a3c8c526aa47 (diff) | |
download | SCons-2ff7ea17b28e6962c48238550d77ec9cdd96c02c.zip SCons-2ff7ea17b28e6962c48238550d77ec9cdd96c02c.tar.gz SCons-2ff7ea17b28e6962c48238550d77ec9cdd96c02c.tar.bz2 |
[ci skip] Document ListSubber.expanded and usage
Diffstat (limited to 'src')
-rw-r--r-- | src/engine/SCons/Subst.py | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/src/engine/SCons/Subst.py b/src/engine/SCons/Subst.py index eec4adf..a1ef053 100644 --- a/src/engine/SCons/Subst.py +++ b/src/engine/SCons/Subst.py @@ -500,6 +500,14 @@ class ListSubber(collections.UserList): self.next_line() def expanded(self, s): + """Determines if the string s requires further expansion. + + Due to the implementation of ListSubber expand will call + itself 2 additional times for an already expanded string. This + method is used to determine if a string is already fully + expanded and if so exit the loop early to prevent these + recursive calls. + """ if not is_String(s) or isinstance(s, CmdStringHolder): return False @@ -561,6 +569,8 @@ class ListSubber(collections.UserList): elif s is None: return + # If the string is already full expanded there's no + # need to continue recursion. if self.expanded(s): self.append(s) return |