changed cursor() from recursion to while loop
modified: api.py
This commit is contained in:
parent
638f75b93d
commit
32337fd036
1 changed files with 25 additions and 27 deletions
|
|
@ -408,6 +408,7 @@ class Twython(EndpointsMixin, object):
|
|||
if not hasattr(function, 'iter_mode'):
|
||||
raise TwythonError('Unable to create generator for Twython method "%s"' % function.__name__)
|
||||
|
||||
while True:
|
||||
content = function(**params)
|
||||
|
||||
if not content:
|
||||
|
|
@ -438,9 +439,6 @@ class Twython(EndpointsMixin, object):
|
|||
except (TypeError, ValueError): # pragma: no cover
|
||||
raise TwythonError('Unable to generate next page of search results, `page` is not a number.')
|
||||
|
||||
for result in self.cursor(function, **params):
|
||||
yield result
|
||||
|
||||
@staticmethod
|
||||
def unicode2utf8(text):
|
||||
try:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue