def limit_handled (self, cursor): while True: try: yield cursor.next() except tweepy.RateLimitError: time.sleep(15 * 60)