More exact section matching for tox showconfig

With the original verbose output support in change
Iafeb88eaf9a596603ad4d2134a4574345d5189ab we looked for lines from
tox --showconfig output starting with an opening '[' but verbosity
also causes output from pip install activity to be included if a
tox.requires entry causes it to install packages before continuing
and these lines are prefixed by a process ID number wrapped in
brackets with the command string after that, which prematurely
triggered our search for the start of the INI content. Add a
stipulation that the first INI output line also end in ']' in order
to skip over those additional prepended lines.

Change-Id: If29e5a9abe3b92a145d87f5efc1b93350ea3908a
This commit is contained in:
Jeremy Stanley 2021-10-01 14:23:32 +00:00
parent 31a470245b
commit 1861faf567

View File

@ -319,7 +319,7 @@ def main():
if not discard:
# Normal operation, tested first for efficiency
tox_clean_config += line
elif line.startswith('['):
elif line.startswith('[') and line.rstrip().endswith(']'):
# Once we see a section heading, stop discarding
discard = False
tox_clean_config += line