diff options
Diffstat (limited to 'tools/patman/settings.py')
-rw-r--r-- | tools/patman/settings.py | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/tools/patman/settings.py b/tools/patman/settings.py index 732bd40106..635561ac05 100644 --- a/tools/patman/settings.py +++ b/tools/patman/settings.py @@ -233,19 +233,17 @@ def _UpdateDefaults(parser, config): config: An instance of _ProjectConfigParser that we will query for settings. """ - defaults = parser.parse_known_args()[0] - defaults = vars(defaults) + defaults = parser.get_default_values() for name, val in config.items('settings'): - if name in defaults: - default_val = defaults[name] + if hasattr(defaults, name): + default_val = getattr(defaults, name) if isinstance(default_val, bool): val = config.getboolean('settings', name) elif isinstance(default_val, int): val = config.getint('settings', name) - defaults[name] = val + parser.set_default(name, val) else: print("WARNING: Unknown setting %s" % name) - parser.set_defaults(**defaults) def _ReadAliasFile(fname): """Read in the U-Boot git alias file if it exists. |