Raise TypeError when cursor is not provided a callable #453

Merged
clayadavis merged 2 commits from master into master 2017-09-25 10:48:54 -07:00
Showing only changes of commit c63ed8559e - Show all commits

View file

@ -470,6 +470,11 @@ class Twython(EndpointsMixin, object):
>>> print result
"""
if not callable(function):
raise TypeError('.cursor() takes a Twython function as its first \
argument. Did you provide the result of a \
function call?')
if not hasattr(function, 'iter_mode'):
raise TwythonError('Unable to create generator for Twython \
method "%s"' % function.__name__)