Cleaning up comment on JSON encoding to be more strictly relevant.

This commit is contained in:
Jesse Shapiro
2016-05-05 12:12:49 -04:00
parent 9ff2e43cd6
commit 52c0daff5f
+2 -3
View File
@@ -420,9 +420,8 @@ class PreparedRequest(RequestEncodingMixin, RequestHooksMixin):
length = None
if not data and json is not None:
# When urllib3 uses pyOpenSSL, it can only resume large uploads
# properly if receiving a bytes-like object. In Python 2, json.dumps()
# returns just that, but Python 3 returns a Unicode string.
# urllib3 requires a bytes-like body. Python 2's json.dumps
# provides this natively, but Python 3 gives a Unicode string.
content_type = 'application/json'
body = complexjson.dumps(json)
if not isinstance(body, bytes):