Chris McDonough
2013-05-22 e391c93bb4f9dec560847d9429d167864db19367
override all known attrs and methods instead of allowing subclass to override in failure case
1 files modified
14 ■■■■■ changed files
pyramid/mako_templating.py 14 ●●●●● patch | view | raw | blame | history
pyramid/mako_templating.py
@@ -25,13 +25,17 @@
try:
    from mako.lookup import TemplateLookup
except (ImportError, SyntaxError, AttributeError): #pragma NO COVER
    def no_mako(*arg, **kw):
        raise NotImplementedError(
            "'mako' package is not importable (maybe downgrade MarkupSafe to "
            "0.16 or below if you're using Python 3.2)"
            )
    class TemplateLookup(object):
        def __init__(self, **kw):
            pass
        def no_mako(self, *args, **kw):
            raise NotImplementedError("'mako' not importable")
        adjust_uri = get_template = filename_to_uri = no_mako
        put_string = put_template = no_mako
            for name in ('adjust_uri', 'get_template', 'filename_to_uri',
                         'put_string', 'put_template'):
                setattr(self, name, no_mako)
            self.filesystem_checks = False
try:
    from mako.exceptions import TopLevelLookupException