Closed nevillepark closed 2 years ago
I think the StopIteration exception is being raised when there's no more items in the cursor - you can trap it with a second except clause and just return:
while True:
try:
yield cursor.next()
except StopIteration:
return
except ty.TooManyRequests:
print("you must have a lot of mutuals or something because we have"
" have officially just hit twitter's api limit. give it some"
" some time to reset, ~15 mins, and the script will pickup")
print("sleeping! {}".format(time.localtime()))
# got fucked by jack's api once again, press F please
time.sleep(60 * 15)
That works, thanks!
In fact it seems that the TooManyRequests exceptions are now totally unnecessary thanks to tweepy's wait_on_rate_limit option.
Program fails with this:
Seems to be due to Python 3.7+ behaviour:
I do not know enough about programming to fix this, but maybe Future Me will, so I'm assigning it to them.