diff options
author | Mats Wichmann <mats@linux.com> | 2020-08-28 16:25:50 (GMT) |
---|---|---|
committer | Mats Wichmann <mats@linux.com> | 2020-08-28 16:25:50 (GMT) |
commit | fe25f9da4744cbe7d6ebd9de24835fb68564880b (patch) | |
tree | c2a0ddde668ac32f90e4076768417b23c80f3978 /SCons/Environment.py | |
parent | f1bc62b1e0dc5fee57a572a5063a708e40702ee0 (diff) | |
download | SCons-fe25f9da4744cbe7d6ebd9de24835fb68564880b.zip SCons-fe25f9da4744cbe7d6ebd9de24835fb68564880b.tar.gz SCons-fe25f9da4744cbe7d6ebd9de24835fb68564880b.tar.bz2 |
[PR #3787] put back a return and update docstring
Fix a review comment on dropped return.
Update the ParseFlags docstring, which contained a reference
to something "below" which only was correct in the context of
looking at the function source; there is no "below" if looking
at the generated API Doc entry.
Signed-off-by: Mats Wichmann <mats@linux.com>
Diffstat (limited to 'SCons/Environment.py')
-rw-r--r-- | SCons/Environment.py | 18 |
1 files changed, 11 insertions, 7 deletions
diff --git a/SCons/Environment.py b/SCons/Environment.py index c874bd0..76128ed 100644 --- a/SCons/Environment.py +++ b/SCons/Environment.py @@ -651,10 +651,14 @@ class SubstitutionEnvironment: Parse ``flags`` and return a dict with the flags distributed into the appropriate construction variable names. The flags are treated - as a typical set of command-line flags for a GNU-like toolchain and - used to populate the entries in the dict immediately below. - If one of the flag strings begins with a bang (exclamation mark), it is - assumed to be a command and the rest of the string is executed; + as a typical set of command-line flags for a GNU-like toolchain, + such as might have been generated by one of the \*-config scripts, + and used to populate the entries based on knowledge embedded in + this method - the choices are not expected to be portable to other + toolchains. + + If one of the ``flags`` strings begins with a bang (exclamation mark), + it is assumed to be a command and the rest of the string is executed; the result of that evaluation is then added to the dict. """ dict = { @@ -1631,7 +1635,7 @@ class Base(SubstitutionEnvironment): if name[:len(prefix)] == prefix and name[-len(suffix):] == suffix: return path - def ParseConfig(self, command, function=None, unique=1): + def ParseConfig(self, command, function=None, unique=True): """ Use the specified function to parse the output of the command in order to modify the current environment. The 'command' can @@ -1644,14 +1648,14 @@ class Base(SubstitutionEnvironment): """ if function is None: def parse_conf(env, cmd, unique=unique): - env.MergeFlags(cmd, unique) + return env.MergeFlags(cmd, unique) function = parse_conf if SCons.Util.is_List(command): command = ' '.join(command) command = self.subst(command) return function(self, self.backtick(command)) - def ParseDepends(self, filename, must_exist=None, only_one=0): + def ParseDepends(self, filename, must_exist=None, only_one=False): """ Parse a mkdep-style file for explicit dependencies. This is completely abusable, and should be unnecessary in the "normal" |