diff --git a/django/core/serializers/pyyaml.py b/django/core/serializers/pyyaml.py
index 5effda5..b983c75 100644
|
a
|
b
|
Requires PyYaml (http://pyyaml.org/), but that's checked for in __init__.
|
| 6 | 6 | |
| 7 | 7 | import decimal |
| 8 | 8 | import yaml |
| 9 | | from io import BytesIO |
| | 9 | from io import BytesIO, StringIO |
| 10 | 10 | |
| 11 | 11 | from django.db import models |
| 12 | 12 | from django.core.serializers.base import DeserializationError |
| … |
… |
def Deserializer(stream_or_string, **options):
|
| 48 | 48 | """ |
| 49 | 49 | Deserialize a stream or string of YAML data. |
| 50 | 50 | """ |
| 51 | | if isinstance(stream_or_string, basestring): |
| | 51 | if isinstance(stream_or_string, str): |
| 52 | 52 | stream = BytesIO(stream_or_string) |
| | 53 | elif isinstance(stream_or_string, unicode): |
| | 54 | stream = StringIO(stream_or_string) |
| 53 | 55 | else: |
| 54 | 56 | stream = stream_or_string |
| 55 | 57 | try: |