1
0
mirror of https://github.com/django/django.git synced 2025-10-30 09:06:13 +00:00

[py3] Made __repr__ return str with Python 3

This commit is contained in:
Claude Paroz
2012-08-12 20:36:43 +02:00
parent c1684e3dcb
commit dce34dc969
5 changed files with 17 additions and 15 deletions

View File

@@ -11,7 +11,7 @@ from django.utils.importlib import import_module
from django.utils.itercompat import is_iterable
from django.utils.text import (smart_split, unescape_string_literal,
get_text_list)
from django.utils.encoding import smart_text, force_text, smart_bytes
from django.utils.encoding import smart_text, force_text, smart_str
from django.utils.translation import ugettext_lazy, pgettext_lazy
from django.utils.safestring import (SafeData, EscapeData, mark_safe,
mark_for_escaping)
@@ -848,7 +848,7 @@ class TextNode(Node):
self.s = s
def __repr__(self):
return "<Text Node: '%s'>" % smart_bytes(self.s[:25], 'ascii',
return "<Text Node: '%s'>" % smart_str(self.s[:25], 'ascii',
errors='replace')
def render(self, context):