]> git.ipfire.org Git - pakfire.git/commitdiff
lexer: Fix inheriting from various lexers.
authorMichael Tremer <michael.tremer@ipfire.org>
Mon, 30 Jan 2012 18:31:19 +0000 (19:31 +0100)
committerMichael Tremer <michael.tremer@ipfire.org>
Mon, 30 Jan 2012 18:31:19 +0000 (19:31 +0100)
python/pakfire/packages/lexer.py

index 16ae0eaf2cc9483a62cd281d02f5739959904aa8..432806d7a8074ce55b4e6d2bf0bd6f0a49fc1636 100644 (file)
@@ -694,8 +694,10 @@ class PackageLexer(TemplateLexer):
                if not self._template:
                        return None
 
-               # Get template from parent.
-               return self.parent.templates.get(self._template, None)
+               # Get template from parent (if exists).
+               templates = getattr(self.parent, "templates", None)
+               if templates:
+                       return templates.get(self._template, None)
 
        def get_parsers(self):
                parsers = [