# HG changeset patch # User Julien Cristau # Date 1443692480 -7200 # Node ID 5318337e7128f3e6ae71a2d629737e41e26f66dc # Parent c5dc40988e6e63f28a01475556b121487368957f [multipart] unicode → six.text_type diff -r c5dc40988e6e -r 5318337e7128 multipart.py --- a/multipart.py Thu Oct 01 10:06:58 2015 +0200 +++ b/multipart.py Thu Oct 01 11:41:20 2015 +0200 @@ -45,6 +45,7 @@ except ImportError: # pragma: no cover (fallback for Python 2.5) from StringIO import StringIO as BytesIO +from six import text_type from six.moves.urllib.parse import parse_qs ############################################################################## @@ -87,7 +88,7 @@ yield key, value def tob(data, enc='utf8'): # Convert strings to bytes (py2 and py3) - return data.encode(enc) if isinstance(data, unicode) else data + return data.encode(enc) if isinstance(data, text_type) else data def copy_file(stream, target, maxread=-1, buffer_size=2*16): ''' Read from :stream and write to :target until :maxread or EOF. '''