From a870c14ec3f9e01c5c6f8d0bbb405bb9c0ee7208 Mon Sep 17 00:00:00 2001 From: CMDR furrycat Date: Sun, 4 Dec 2016 11:25:53 +0000 Subject: [PATCH] Handle types in parse_seconds(). The supplied argument might actually be an int. The returned value must always be an int. --- bot.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/bot.py b/bot.py index e62367d..e3b8d79 100644 --- a/bot.py +++ b/bot.py @@ -59,10 +59,10 @@ def parse_boolean(string): return False def parse_seconds(formatted): - formatted = formatted.strip() + formatted = str(formatted).strip() m = re.match(r'(\d+)s?$', formatted) if m is not None: - return m.group(1) + return int(m.group(1)) remaining = formatted seconds = 0 while remaining: -- 2.7.4