diff mbox series

[3/6] patman: Don't look at sys.argv when parsing settings

Message ID 20220630140742.3.I7a1d18f39af70389a687dedef421cda4d0ae35a9@changeid
State Superseded
Delegated to: Simon Glass
Headers show
Series patman: Small fixes plus remove --no-tree from checkpatch for linux | expand

Commit Message

Doug Anderson June 30, 2022, 9:08 p.m. UTC
If you call the parser and tell it to parse but don't pass arguments
in then it will default to looking at sys.argv. This isn't really what
was intended and seems to have some side effects. Let's not do it.

NOTE: to see some of the side effects, note that this patch breaks
"patman -c1" if you don't have the patch ("patman: Fix implicit
command inserting") before it.

Signed-off-by: Douglas Anderson <dianders@chromium.org>
---

 tools/patman/settings.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
diff mbox series

Patch

diff --git a/tools/patman/settings.py b/tools/patman/settings.py
index 5eefe3d1f55e..92d82d5e8682 100644
--- a/tools/patman/settings.py
+++ b/tools/patman/settings.py
@@ -248,7 +248,7 @@  def _UpdateDefaults(main_parser, config):
 
     # Collect the defaults from each parser
     for parser in parsers:
-        pdefs = parser.parse_known_args()[0]
+        pdefs = parser.parse_known_args([])[0]
         defaults = dict(vars(pdefs))
 
         # Go through the settings and collect defaults