Actually pass format args to ValueErrors in utils.parse_number
This commit is contained in:
parent
f096bddff4
commit
d427e29936
1 changed files with 2 additions and 2 deletions
|
@ -92,7 +92,7 @@ def parse_number(s):
|
||||||
unit = s[-1].lower()
|
unit = s[-1].lower()
|
||||||
number = s[:-1]
|
number = s[:-1]
|
||||||
if not number.isdigit():
|
if not number.isdigit():
|
||||||
raise ValueError("Invalid format '%s' passed to parse_number")
|
raise ValueError("Invalid format '%s' passed to parse_number" % number)
|
||||||
number = int(number)
|
number = int(number)
|
||||||
|
|
||||||
if unit == "k":
|
if unit == "k":
|
||||||
|
@ -102,7 +102,7 @@ def parse_number(s):
|
||||||
elif unit == "b":
|
elif unit == "b":
|
||||||
number *= 1_000_000_000
|
number *= 1_000_000_000
|
||||||
else:
|
else:
|
||||||
raise ValueError("Unknown unit '%s' given to parse_number")
|
raise ValueError("Unknown unit '%s' given to parse_number" % unit)
|
||||||
return str(number)
|
return str(number)
|
||||||
|
|
||||||
IS_TRUE = ["true", "yes", "on", "y"]
|
IS_TRUE = ["true", "yes", "on", "y"]
|
||||||
|
|
Loading…
Reference in a new issue