=== modified file 'django/template/__init__.py'
--- django/template/__init__.py	2007-02-05 04:47:35 +0000
+++ django/template/__init__.py	2007-02-05 08:04:02 +0000
@@ -117,8 +117,14 @@
     pass
 
 class VariableDoesNotExist(Exception):
-    pass
 
+    def __init__(self, msg, params=()):
+        self.msg = msg
+        self.params = params
+    
+    def __str__(self):
+        return self.mgs % self.params
+    
 class InvalidTemplateLibrary(Exception):
     pass
 
@@ -658,7 +664,7 @@
                     try: # list-index lookup
                         current = current[int(bits[0])]
                     except (IndexError, ValueError, KeyError):
-                        raise VariableDoesNotExist, "Failed lookup for key [%s] in %r" % (bits[0], current) # missing attribute
+                        raise VariableDoesNotExist("Failed lookup for key [%s] in %r", (bits[0], current)) # missing attribute
                 except Exception, e:
                     if not getattr(e, 'silent_variable_failure', False):
                         raise

