aboutsummaryrefslogtreecommitdiff
path: root/src/utils
diff options
context:
space:
mode:
authorGravatar jesopo2018-10-12 11:21:57 +0100
committerGravatar jesopo2018-10-12 11:21:57 +0100
commitd427e29936d47cc295550ec0a0cb87df3cbd37c1 (patch)
treea99299336bcb36f57021e3de6449f656a7554980 /src/utils
parentSupport unit-based bets (1k/1m/1b) in modules/coins.py (diff)
signature
Actually pass format args to ValueErrors in utils.parse_number
Diffstat (limited to 'src/utils')
-rw-r--r--src/utils/__init__.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/utils/__init__.py b/src/utils/__init__.py
index c8312ead..6792ee1f 100644
--- a/src/utils/__init__.py
+++ b/src/utils/__init__.py
@@ -92,7 +92,7 @@ def parse_number(s):
unit = s[-1].lower()
number = s[:-1]
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)
if unit == "k":
@@ -102,7 +102,7 @@ def parse_number(s):
elif unit == "b":
number *= 1_000_000_000
else:
- raise ValueError("Unknown unit '%s' given to parse_number")
+ raise ValueError("Unknown unit '%s' given to parse_number" % unit)
return str(number)
IS_TRUE = ["true", "yes", "on", "y"]