From: Josh Roesslein Date: Fri, 6 Nov 2009 01:20:00 +0000 (-0600) Subject: Fix bug in cursor that would cause an error to happen with empty data results. X-Git-Url: https://vcs.fsf.org/?a=commitdiff_plain;h=eb909d04df931f84ca77bfc046d340b247dc71b7;p=tweepy.git Fix bug in cursor that would cause an error to happen with empty data results. --- diff --git a/tweepy/cursor.py b/tweepy/cursor.py index 3f316ab..0f762f4 100644 --- a/tweepy/cursor.py +++ b/tweepy/cursor.py @@ -59,6 +59,8 @@ class CursorIterator(BaseIterator): data, self.next_cursor, self.prev_cursor = self.method( cursor=self.next_cursor, *self.args, **self.kargs ) + if len(data) == 0: + raise StopIteration self.count += 1 return data