Twitter: catch ValueError if the provided index isn't a number at all

This commit is contained in:
Brian S. Stephan 2011-06-21 17:24:31 -05:00
parent ad4d75f724
commit 9745cfc9be
1 changed files with 9 additions and 4 deletions

View File

@ -138,12 +138,17 @@ class Twitter(Module):
user = match.group(1)
index = match.group(2)
if index:
index = int(index)
if index > 0:
try:
if index:
index = int(index)
if index > 0:
index = 0
else:
index = 0
else:
except ValueError as e:
print('Couldn\'t convert index: ' + str(e))
index = 0
count = (-1*index) + 1
try: