From eb909d04df931f84ca77bfc046d340b247dc71b7 Mon Sep 17 00:00:00 2001 From: Josh Roesslein Date: Thu, 5 Nov 2009 19:20:00 -0600 Subject: [PATCH] Fix bug in cursor that would cause an error to happen with empty data results. --- tweepy/cursor.py | 2 ++ 1 file changed, 2 insertions(+) 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 -- 2.25.1