Fix CLI parser to accept negative integers as valid (#927)
Fixes #11381
This commit is contained in:
parent
c312c96987
commit
f7bd062bdb
@ -88,9 +88,9 @@ def _convert_str_to_match_type(str_val, type_val):
|
|||||||
return str(str_val)
|
return str(str_val)
|
||||||
|
|
||||||
elif ret_type == int:
|
elif ret_type == int:
|
||||||
if str_val.isdigit():
|
try:
|
||||||
return int(str_val)
|
return int(str_val)
|
||||||
else:
|
except ValueError:
|
||||||
print("'%s' is not an integer number" % str_val)
|
print("'%s' is not an integer number" % str_val)
|
||||||
return 0
|
return 0
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user