From ee805e286097c76d7c6f243ff248bc3461622682 Mon Sep 17 00:00:00 2001 From: Jeremy Fincher Date: Tue, 3 Jun 2003 03:25:19 +0000 Subject: [PATCH] Fixed IndexError on empty deepthoughtq. --- plugins/Http.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/plugins/Http.py b/plugins/Http.py index 66a43dde6..bfdd0d1a5 100644 --- a/plugins/Http.py +++ b/plugins/Http.py @@ -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)