diff options
| author | Xavier Ordoquy | 2012-11-24 23:19:03 +0100 | 
|---|---|---|
| committer | Xavier Ordoquy | 2012-11-24 23:19:03 +0100 | 
| commit | 17000129e35b10c9d08497a669fd72f8233f065a (patch) | |
| tree | d8edb15c1b74bfa81f6483fa15055b4ba3599b7a /rest_framework/utils | |
| parent | 237e35120decb508bbad560b23ceacbcd6fccdf3 (diff) | |
| download | django-rest-framework-17000129e35b10c9d08497a669fd72f8233f065a.tar.bz2 | |
Every (base) test should now pass with python3.
Diffstat (limited to 'rest_framework/utils')
| -rw-r--r-- | rest_framework/utils/__init__.py | 5 | 
1 files changed, 4 insertions, 1 deletions
diff --git a/rest_framework/utils/__init__.py b/rest_framework/utils/__init__.py index a2406852..45879353 100644 --- a/rest_framework/utils/__init__.py +++ b/rest_framework/utils/__init__.py @@ -1,8 +1,11 @@ +import six +  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 @@ -74,7 +77,7 @@ class XMLRenderer():                  xml.endElement("list-item")          elif isinstance(data, dict): -            for key, value in data.iteritems(): +            for key, value in six.iteritems(data):                  xml.startElement(key, {})                  self._to_xml(xml, value)                  xml.endElement(key)  | 
