diff options
| author | Xavier Ordoquy | 2012-11-22 07:48:41 +0100 |
|---|---|---|
| committer | Xavier Ordoquy | 2012-11-22 07:48:41 +0100 |
| commit | be003145ca120708db51db4e85f6088bde8dce1c (patch) | |
| tree | 9df0e343b9adc196ddd7e5fbc1b93e4c339260b2 /rest_framework/utils/__init__.py | |
| parent | 91190487b747f0c9c09ecd5678f719bb2e745d27 (diff) | |
| parent | 606c20f012c5a1fdcfd661eb280bab22b94afcf5 (diff) | |
| download | django-rest-framework-be003145ca120708db51db4e85f6088bde8dce1c.tar.bz2 | |
Merge branch 'p3k' of github.com:linovia/django-rest-framework into p3k
Diffstat (limited to 'rest_framework/utils/__init__.py')
| -rw-r--r-- | rest_framework/utils/__init__.py | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/rest_framework/utils/__init__.py b/rest_framework/utils/__init__.py index 84fcb5db..a2406852 100644 --- a/rest_framework/utils/__init__.py +++ b/rest_framework/utils/__init__.py @@ -1,4 +1,8 @@ -from django.utils.encoding import smart_unicode + +try: + from django.utils.encoding import smart_text +except ImportError: + from django.utils.encoding import smart_unicode as smart_text from django.utils.xmlutils import SimplerXMLGenerator from rest_framework.compat import StringIO import re @@ -80,10 +84,10 @@ class XMLRenderer(): pass else: - xml.characters(smart_unicode(data)) + xml.characters(smart_text(data)) def dict2xml(self, data): - stream = StringIO.StringIO() + stream = StringIO() xml = SimplerXMLGenerator(stream, "utf-8") xml.startDocument() |
