Twython/api.py: suggested changes in review have been made for pull request 460
This commit is contained in:
parent
6fc7b9e038
commit
2cb2ed4a31
1 changed files with 3 additions and 3 deletions
|
|
@ -140,7 +140,7 @@ class Twython(EndpointsMixin, object):
|
||||||
params = params or {}
|
params = params or {}
|
||||||
|
|
||||||
func = getattr(self.client, method)
|
func = getattr(self.client, method)
|
||||||
if type(params) is dict:
|
if isinstance(params, dict):
|
||||||
params, files = _transparent_params(params)
|
params, files = _transparent_params(params)
|
||||||
else:
|
else:
|
||||||
params = params
|
params = params
|
||||||
|
|
@ -196,14 +196,14 @@ class Twython(EndpointsMixin, object):
|
||||||
error_message,
|
error_message,
|
||||||
error_code=response.status_code,
|
error_code=response.status_code,
|
||||||
retry_after=response.headers.get('X-Rate-Limit-Reset'))
|
retry_after=response.headers.get('X-Rate-Limit-Reset'))
|
||||||
content=""
|
content = ''
|
||||||
try:
|
try:
|
||||||
if response.status_code == 204:
|
if response.status_code == 204:
|
||||||
content = response.content
|
content = response.content
|
||||||
else:
|
else:
|
||||||
content = response.json()
|
content = response.json()
|
||||||
except ValueError:
|
except ValueError:
|
||||||
if response.content!="":
|
if response.content != '':
|
||||||
raise TwythonError('Response was not valid JSON. \
|
raise TwythonError('Response was not valid JSON. \
|
||||||
Unable to decode.')
|
Unable to decode.')
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue