Fixed names of genshi exceptions/functions.
authorPhilipp Spitzer <philipp@spitzer.priv.at>
Tue, 5 May 2015 19:33:09 +0000 (21:33 +0200)
committerPhilipp Spitzer <philipp@spitzer.priv.at>
Tue, 5 May 2015 19:33:09 +0000 (21:33 +0200)
django_template_backend_genshi/__init__.py

index 2772434b4b180aac6f92006766393987f7ec184f..c9d365573a7e54d918102d2662e55ffa99580ec8 100644 (file)
@@ -1,6 +1,8 @@
 from django.template.backends.utils import csrf_input_lazy, csrf_token_lazy
 import django.template.backends.base
 import genshi.template
+import genshi.template.loader
+import genshi.template.base
 
 
 class GenshiEngine(django.template.backends.base.BaseEngine):
@@ -18,17 +20,17 @@ class GenshiEngine(django.template.backends.base.BaseEngine):
         try:
             template = genshi.template.MarkupTemplate(template_code)
             return GenshiTemplateWrapper(template)
-        except genshi.TemplateCompilationFailed as exc:
+        except genshi.template.base.TemplateSyntaxError as exc:
             raise django.template.TemplateSyntaxError(exc.args)
 
 
     def get_template(self, template_name):
         try:
             template = self.loader.load(template_name)
-            return GenshiTemplateWrapper(self.loader.get_template(template_name))
-        except genshi.TemplateNotFound as exc:
+            return GenshiTemplateWrapper(self.loader.load(template_name))
+        except genshi.template.loader.TemplateNotFound as exc:
             raise django.template.TemplateDoesNotExist(exc.args)
-        except genshi.TemplateCompilationFailed as exc:
+        except genshi.template.base.TemplateSyntaxError as exc:
             raise django.template.TemplateSyntaxError(exc.args)