Fix bug in cursor that would cause an error to happen with empty data results.
authorJosh Roesslein <jroesslein@gmail.com>
Fri, 6 Nov 2009 01:20:00 +0000 (19:20 -0600)
committerJosh Roesslein <jroesslein@gmail.com>
Fri, 6 Nov 2009 01:20:00 +0000 (19:20 -0600)
tweepy/cursor.py

index 3f316abb94a0d2e761728a168d782496f1390d92..0f762f4b1f10066bc04d84fa6c8d5afdd449fb3b 100644 (file)
@@ -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