summaryrefslogtreecommitdiff
path: root/django/template/base.py
diff options
context:
space:
mode:
Diffstat (limited to 'django/template/base.py')
-rw-r--r--django/template/base.py4
1 files changed, 3 insertions, 1 deletions
diff --git a/django/template/base.py b/django/template/base.py
index 4dcba6dd2b..24ad9320e0 100644
--- a/django/template/base.py
+++ b/django/template/base.py
@@ -20,6 +20,7 @@ from django.utils.html import escape
from django.utils.module_loading import module_has_submodule
from django.utils import six
from django.utils.timezone import template_localtime
+from django.utils.encoding import python_2_unicode_compatible
TOKEN_TEXT = 0
@@ -79,13 +80,14 @@ class TemplateDoesNotExist(Exception):
class TemplateEncodingError(Exception):
pass
+@python_2_unicode_compatible
class VariableDoesNotExist(Exception):
def __init__(self, msg, params=()):
self.msg = msg
self.params = params
- def __unicode__(self):
+ def __str__(self):
return self.msg % tuple([force_text(p, errors='replace')
for p in self.params])