From f2fe7a3e36bebb529f33f5b702b7643a3db85c72 Mon Sep 17 00:00:00 2001 From: Claude Paroz Date: Tue, 14 Aug 2012 19:48:38 +0200 Subject: [py3] Fixed serializers tests --- django/core/serializers/base.py | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) (limited to 'django') diff --git a/django/core/serializers/base.py b/django/core/serializers/base.py index bdb43db9f3..276f9a4738 100644 --- a/django/core/serializers/base.py +++ b/django/core/serializers/base.py @@ -2,8 +2,6 @@ Module for abstract serializer/unserializer base classes. """ -from io import BytesIO - from django.db import models from django.utils.encoding import smart_text from django.utils import six @@ -35,7 +33,7 @@ class Serializer(object): """ self.options = options - self.stream = options.pop("stream", BytesIO()) + self.stream = options.pop("stream", six.StringIO()) self.selected_fields = options.pop("fields", None) self.use_natural_keys = options.pop("use_natural_keys", False) @@ -125,7 +123,7 @@ class Deserializer(object): """ self.options = options if isinstance(stream_or_string, six.string_types): - self.stream = BytesIO(stream_or_string) + self.stream = six.StringIO(stream_or_string) else: self.stream = stream_or_string # hack to make sure that the models have all been loaded before -- cgit v1.3