mirror of
https://github.com/encode/django-rest-framework.git
synced 2025-02-03 13:14:30 +03:00
Use six.BytesIO in tutorial. Closes #2296.
This commit is contained in:
parent
265ed9377e
commit
90b8f9221e
|
@ -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)
|
||||||
|
|
Loading…
Reference in New Issue
Block a user