git://git.furryclan.net
/
furrycat
/
catbot.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
de20372
)
Handle types in parse_seconds().
author
CMDR furrycat
<elite@furrycat.net>
Sun, 4 Dec 2016 11:25:53 +0000
(11:25 +0000)
committer
CMDR furrycat
<elite@furrycat.net>
Sun, 4 Dec 2016 11:25:53 +0000
(11:25 +0000)
The supplied argument might actually be an int.
The returned value must always be an int.
bot.py
patch
|
blob
|
history
diff --git
a/bot.py
b/bot.py
index
e62367d
..
e3b8d79
100644
(file)
--- 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: