Ticket #5884: 5884.diff

File 5884.diff, 1.2 KB (added by Karen Tracey <kmtracey@…>, 17 years ago)
  • django/template/__init__.py

     
    125125class VariableDoesNotExist(Exception):
    126126
    127127    def __init__(self, msg, params=()):
    128         self.msg = msg
    129         self.params = params
     128        self.msg = force_unicode(msg)
     129        self.params = tuple([force_unicode(x) for x in params])
    130130
    131     def __str__(self):
     131    def __unicode__(self):
    132132        return self.msg % self.params
    133133
    134134class InvalidTemplateLibrary(Exception):
  • django/template/debug.py

     
    7575            raise
    7676        except Exception, e:
    7777            from sys import exc_info
    78             wrapped = TemplateSyntaxError('Caught an exception while rendering: %s' % e)
     78            wrapped = TemplateSyntaxError(u'Caught an exception while rendering: %s' % e)
    7979            wrapped.source = node.source
    8080            wrapped.exc_info = exc_info()
    8181            raise wrapped
Back to Top