提交 3a2a8ff2 编写于 作者: Y Yang Zhang 提交者: qingqing01

Fix a bug in command line option parsing (#2941)

option should not be overridden by subsequent options of the same module.
上级 457615c1
...@@ -68,6 +68,7 @@ class ArgsParser(ArgumentParser): ...@@ -68,6 +68,7 @@ class ArgsParser(ArgumentParser):
config[k] = yaml.load(v, Loader=yaml.Loader) config[k] = yaml.load(v, Loader=yaml.Loader)
else: else:
keys = k.split('.') keys = k.split('.')
if keys[0] not in config:
config[keys[0]] = {} config[keys[0]] = {}
cur = config[keys[0]] cur = config[keys[0]]
for idx, key in enumerate(keys[1:]): for idx, key in enumerate(keys[1:]):
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册