mirror of
https://github.com/django/django.git
synced 2025-11-01 12:25:37 +00:00
Replaced cStringIO.StringIO by io.BytesIO.
Also replaced StringIO.StringIO by BytesIO in some other appropriate places. StringIO is not available in Python 3.
This commit is contained in:
parent
1583d40224
commit
d7dfab59ea
26 changed files with 94 additions and 167 deletions
|
|
@ -10,10 +10,7 @@ from __future__ import absolute_import
|
|||
|
||||
import datetime
|
||||
import decimal
|
||||
try:
|
||||
from cStringIO import StringIO
|
||||
except ImportError:
|
||||
from StringIO import StringIO
|
||||
from io import BytesIO
|
||||
|
||||
try:
|
||||
import yaml
|
||||
|
|
@ -504,7 +501,7 @@ def streamTest(format, self):
|
|||
obj.save_base(raw=True)
|
||||
|
||||
# Serialize the test database to a stream
|
||||
stream = StringIO()
|
||||
stream = BytesIO()
|
||||
serializers.serialize(format, [obj], indent=2, stream=stream)
|
||||
|
||||
# Serialize normally for a comparison
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue