=== modified file 'django/template/__init__.py'
|
|
|
117 | 117 | pass |
118 | 118 | |
119 | 119 | class VariableDoesNotExist(Exception): |
120 | | pass |
121 | 120 | |
| 121 | def __init__(self, msg, params=()): |
| 122 | self.msg = msg |
| 123 | self.params = params |
| 124 | |
| 125 | def __str__(self): |
| 126 | return self.mgs % self.params |
| 127 | |
122 | 128 | class InvalidTemplateLibrary(Exception): |
123 | 129 | pass |
124 | 130 | |
… |
… |
|
658 | 664 | try: # list-index lookup |
659 | 665 | current = current[int(bits[0])] |
660 | 666 | except (IndexError, ValueError, KeyError): |
661 | | raise VariableDoesNotExist, "Failed lookup for key [%s] in %r" % (bits[0], current) # missing attribute |
| 667 | raise VariableDoesNotExist("Failed lookup for key [%s] in %r", (bits[0], current)) # missing attribute |
662 | 668 | except Exception, e: |
663 | 669 | if not getattr(e, 'silent_variable_failure', False): |
664 | 670 | raise |