fix TypeError in python 3

move 383d1e9970 to 2017.7
python3 expect str instead of bytes
This commit is contained in:
angeloudy 2017-12-20 09:49:07 +11:00 committed by GitHub
parent a4358dfa36
commit 177fd18671
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -429,6 +429,8 @@ def query(url,
'charset' in res_params and \
not isinstance(result_text, six.text_type):
result_text = result_text.decode(res_params['charset'])
if isinstance(result_text, bytes):
result_text = result.body.decode('utf-8')
ret['body'] = result_text
else:
# Tornado