python 3 port: manual fixes, remove 2to3 from setup.py, remove fixers
diff --git a/jinja2/exceptions.py b/jinja2/exceptions.py
index 9002521..f38d347 100644
--- a/jinja2/exceptions.py
+++ b/jinja2/exceptions.py
@@ -9,8 +9,7 @@
:license: BSD, see LICENSE for more details.
"""
import six
-from six.moves import map
-from six.moves import zip
+from six.moves import map, zip
class TemplateError(Exception):
@@ -66,7 +65,7 @@
def __init__(self, names=(), message=None):
if message is None:
message = u'none of the templates given were found: ' + \
- u', '.join(map(unicode, names))
+ u', '.join(map(six.text_type, names))
TemplateNotFound.__init__(self, names and names[-1] or None, message)
self.templates = list(names)
@@ -86,12 +85,9 @@
self.translated = False
def __str__(self):
- return six.text_type(self).encode('utf-8')
+ s = self.__unicode__()
+ return s if six.PY3 else s.encode('utf-8')
- # unicode goes after __str__ because we configured 2to3 to rename
- # __unicode__ to __str__. because the 2to3 tree is not designed to
- # remove nodes from it, we leave the above __str__ around and let
- # it override at runtime.
def __unicode__(self):
# for translated errors we only return the message
if self.translated: