Commit 474a5543 authored by Stefan Behnel's avatar Stefan Behnel

move 'unicode' name in Tempita out of the way of 2to3 in Py3.2

parent 97dda59a
...@@ -43,7 +43,7 @@ import tokenize ...@@ -43,7 +43,7 @@ import tokenize
from io import StringIO from io import StringIO
from ._looper import looper from ._looper import looper
from .compat3 import bytes, unicode, basestring_, next, is_unicode, coerce_text from .compat3 import bytes, unicode_, basestring_, next, is_unicode, coerce_text
__all__ = ['TemplateError', 'Template', 'sub', 'HTMLTemplate', __all__ = ['TemplateError', 'Template', 'sub', 'HTMLTemplate',
'sub_html', 'html', 'bunch'] 'sub_html', 'html', 'bunch']
...@@ -328,7 +328,7 @@ class Template(object): ...@@ -328,7 +328,7 @@ class Template(object):
return '' return ''
if self._unicode: if self._unicode:
try: try:
value = unicode(value) value = unicode_(value)
except UnicodeDecodeError: except UnicodeDecodeError:
value = bytes(value) value = bytes(value)
else: else:
......
import sys import sys
__all__ = ['b', 'basestring_', 'bytes', 'unicode', 'next', 'is_unicode'] __all__ = ['b', 'basestring_', 'bytes', 'unicode_', 'next', 'is_unicode']
if sys.version < "3": if sys.version < "3":
b = bytes = str b = bytes = str
basestring_ = basestring basestring_ = basestring
unicode = unicode unicode_ = unicode
else: else:
def b(s): def b(s):
...@@ -14,7 +14,7 @@ else: ...@@ -14,7 +14,7 @@ else:
return bytes(s) return bytes(s)
basestring_ = (bytes, str) basestring_ = (bytes, str)
bytes = bytes bytes = bytes
unicode = str unicode_ = str
text = str text = str
if sys.version < "3": if sys.version < "3":
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment