Streamlined code. Removed an unnecessary leftover.
authorArmin Ronacher <armin.ronacher@active-4.com>
Fri, 12 Mar 2010 02:27:33 +0000 (03:27 +0100)
committerArmin Ronacher <armin.ronacher@active-4.com>
Fri, 12 Mar 2010 02:27:33 +0000 (03:27 +0100)
--HG--
branch : trunk

jinja2/loaders.py

index 5c82b799b3edc32efa90c5070de5df3a3c328618..bd435e8b086d7c2c4916c49500850f2edfa44071 100644 (file)
@@ -385,13 +385,7 @@ class ChoiceLoader(BaseLoader):
 
 
 class _TemplateModule(ModuleType):
-
-    def __init__(self, module):
-        if isinstance(module, basestring):
-            super(_TemplateModule, self).__init__(module)
-        else:
-            super(_TemplateModule, self).__init__(module.__name__)
-            self.__dict__.update(module.__dict__)
+    """Like a normal module but with support for weak references"""
 
 
 class ModuleLoader(BaseLoader):
@@ -443,8 +437,7 @@ class ModuleLoader(BaseLoader):
         mod = getattr(self.module, module, None)
         if mod is None:
             try:
-                mod = _TemplateModule(__import__(module, None,
-                                                 None, ['root']))
+                mod = __import__(module, None, None, ['root'])
             except ImportError:
                 raise TemplateNotFound(name)