mirror of
https://github.com/clearml/clearml
synced 2025-03-03 18:52:12 +00:00
Fix nargs="?" without type does not properly cast the default value (#531)
This commit is contained in:
parent
34fc80b039
commit
e98e6acae1
@ -313,6 +313,12 @@ class _Arguments(object):
|
||||
# now we should try and cast the value if we can
|
||||
# noinspection PyBroadException
|
||||
try:
|
||||
# Since we have no actual var type here, we check if the string presentation of the original
|
||||
# default value and the new value are the same, if they are,
|
||||
# we should just use the original default value
|
||||
if str(v) == str(current_action.default):
|
||||
v = current_action.default
|
||||
else:
|
||||
v = var_type(v)
|
||||
# cast back to int if it's the same value
|
||||
if type(current_action.default) == int and int(v) == v:
|
||||
|
Loading…
Reference in New Issue
Block a user