tools: fix default for SinglePropertyAction
For positional arguments default is sent to __call__ even when not provided on command line. Exclude it in SinglePropertyAction, since "default" value is really meant for 'properties' attribute, not individual property.
This commit is contained in:
parent
984ea09cef
commit
4113651f01
@ -107,6 +107,9 @@ class SinglePropertyAction(argparse.Action):
|
||||
|
||||
|
||||
def __call__(self, parser, namespace, values, option_string=None):
|
||||
if values is self.default and self.default == {}:
|
||||
return
|
||||
|
||||
properties = getattr(namespace, self.dest)
|
||||
# copy it, to not modify _mutable_ self.default
|
||||
if not properties:
|
||||
|
Loading…
Reference in New Issue
Block a user