bear / python-twitter

A Python wrapper around the Twitter API.
Apache License 2.0
3.41k stars 957 forks source link

Exception: _RequestUrl breaks fi no data and no json #584

Closed cgthayer closed 5 years ago

cgthayer commented 6 years ago

Minor, some cases set resp = 0 which causes an exception if the rate_limit is set

if url and self.rate_limit: should be

if url and self.rate_limit and resp:

cgthayer commented 6 years ago

@jeremylow looks like you were the last to touch this line (though it was very long ago)

cgthayer commented 6 years ago

Context: I was trying to use the Account Activity API, but it looks like there's no direct support. My goal is to write a chatbot that receives (and replies to) Direct Messages, so I wanted to register my webhook. Tried to use api._RequestUrl()

jeremylow commented 5 years ago

Thanks!