from tornado.escape import utf8, native_str
from tornado.httpclient import HTTPRequest, HTTPResponse, HTTPError, AsyncHTTPClient, main, _RequestProxy
+from tornado.util import bytes_type
try:
from io import BytesIO # py3
write_function = request.streaming_callback
else:
write_function = buffer.write
- if type(b'') is type(''): # py2
+ if bytes_type is str: # py2
curl.setopt(pycurl.WRITEFUNCTION, write_function)
else: # py3
# Upstream pycurl doesn't support py3, but ubuntu 12.10 includes