"vscode:/vscode.git/clone" did not exist on "dc07ac2add8285e16a716564867d0b4b953f6735"
Commit d28527d5 authored by Raul Puri's avatar Raul Puri
Browse files

changed default override behavior

parent ef5b2f06
...@@ -52,8 +52,11 @@ def parse_args(extra_args_provider=None, defaults={}, ...@@ -52,8 +52,11 @@ def parse_args(extra_args_provider=None, defaults={},
# For default to be valid, it should not be provided in the # For default to be valid, it should not be provided in the
# arguments that are passed to the program. We check this by # arguments that are passed to the program. We check this by
# ensuring the arg is set to None. # ensuring the arg is set to None.
assert getattr(args, key) is None, \ if getattr(args, key) is not None:
'defaults can only be overwritten for args with None values.' print('WARNING: overriding default arguments for {key}:{v} with \
{key}:{v2}'.format(key=key, v=defaults[key],
v2=getattr(args, key))
else:
setattr(args, key, defaults[key]) setattr(args, key, defaults[key])
# Check required arguments. # Check required arguments.
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment