mirror of
https://github.com/clearml/clearml
synced 2025-03-03 18:52:12 +00:00
Fix argparse with action="append"
This commit is contained in:
parent
794d97ca7c
commit
d4317f8b87
@ -2,7 +2,7 @@ import yaml
|
|||||||
|
|
||||||
from inspect import isfunction
|
from inspect import isfunction
|
||||||
from six import PY2
|
from six import PY2
|
||||||
from argparse import _StoreAction, ArgumentError, _StoreConstAction, _SubParsersAction, SUPPRESS # noqa
|
from argparse import _StoreAction, ArgumentError, _StoreConstAction, _SubParsersAction, _AppendAction, SUPPRESS # noqa
|
||||||
from copy import copy
|
from copy import copy
|
||||||
|
|
||||||
from ...backend_api import Session
|
from ...backend_api import Session
|
||||||
@ -266,7 +266,9 @@ class _Arguments(object):
|
|||||||
pass
|
pass
|
||||||
if current_action.default is not None or const_value not in (None, ''):
|
if current_action.default is not None or const_value not in (None, ''):
|
||||||
arg_parser_arguments[k] = const_value
|
arg_parser_arguments[k] = const_value
|
||||||
elif current_action and (current_action.nargs in ('+', '*') or isinstance(current_action.nargs, int)):
|
elif current_action and (
|
||||||
|
current_action.nargs in ('+', '*') or isinstance(current_action.nargs, int) or
|
||||||
|
isinstance(current_action, _AppendAction)):
|
||||||
# noinspection PyBroadException
|
# noinspection PyBroadException
|
||||||
try:
|
try:
|
||||||
v = yaml.load(v.strip(), Loader=yaml.SafeLoader)
|
v = yaml.load(v.strip(), Loader=yaml.SafeLoader)
|
||||||
|
Loading…
Reference in New Issue
Block a user