Fixed IndexError on empty deepthoughtq.

This commit is contained in:
Jeremy Fincher 2003-06-03 03:25:19 +00:00
parent b1a1c85a17
commit ee805e2860

View File

@ -62,7 +62,8 @@ class Http(callbacks.Privmsg):
"""
url = 'http://www.tremorseven.com/aim/deepaim.php?job=view'
thought = ' ' * 512
while time.time() - self.deepthoughtq[0][0] > 86400:
now = time.time()
while self.deepthoughtq and now - self.deepthoughtq[0][0] > 86400:
self.deepthoughtq.dequeue()
while len(thought) > 450 or thought in self.deepthoughtq:
fd = urllib2.urlopen(url)