diff options
| author | Chris McDonough <chrism@plope.com> | 2013-05-21 19:16:34 -0400 |
|---|---|---|
| committer | Chris McDonough <chrism@plope.com> | 2013-05-21 19:17:08 -0400 |
| commit | 6b559994fe4006e8cc0d2135f1f4548a60ab8ff0 (patch) | |
| tree | 63bc961a7af63bded88f6493c82e4d6cef14467c | |
| parent | d4495efddce30cf2eef771ac28e2d90b86985d39 (diff) | |
| download | pyramid-6b559994fe4006e8cc0d2135f1f4548a60ab8ff0.tar.gz pyramid-6b559994fe4006e8cc0d2135f1f4548a60ab8ff0.tar.bz2 pyramid-6b559994fe4006e8cc0d2135f1f4548a60ab8ff0.zip | |
override all known attrs and methods instead of allowing subclass to override in failure case
| -rw-r--r-- | pyramid/mako_templating.py | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/pyramid/mako_templating.py b/pyramid/mako_templating.py index 69b48a3b5..31c398862 100644 --- a/pyramid/mako_templating.py +++ b/pyramid/mako_templating.py @@ -25,13 +25,17 @@ from pyramid.util import DottedNameResolver 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 |
