Use six.BytesIO in tutorial. Closes #2296.

This commit is contained in:
Tom Christie 2014-12-17 16:23:00 +00:00
parent 265ed9377e
commit 90b8f9221e

View File

@ -163,7 +163,7 @@ Deserialization is similar. First we parse a stream into Python native datatype
# This import will use either `StringIO.StringIO` or `io.BytesIO` # This import will use either `StringIO.StringIO` or `io.BytesIO`
# as appropriate, depending on if we're running Python 2 or Python 3. # as appropriate, depending on if we're running Python 2 or Python 3.
from rest_framework.compat import BytesIO from django.utils.six import BytesIO
stream = BytesIO(content) stream = BytesIO(content)
data = JSONParser().parse(stream) data = JSONParser().parse(stream)