From eb1211421915b0c3d9973b387603f999ded34037 Mon Sep 17 00:00:00 2001 From: Armin Ronacher Date: Mon, 20 May 2013 02:12:34 +0100 Subject: Removed an unnecessary check --- jinja2/runtime.py | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/jinja2/runtime.py b/jinja2/runtime.py index 14162e6..71485c8 100644 --- a/jinja2/runtime.py +++ b/jinja2/runtime.py @@ -174,14 +174,13 @@ class Context(object): __traceback_hide__ = True # Allow callable classes to take a context - if hasattr(__obj, '__call__'): - fn = __obj.__call__ - for fn_type in ('contextfunction', - 'evalcontextfunction', - 'environmentfunction'): - if hasattr(fn, fn_type): - __obj = fn - break + fn = __obj.__call__ + for fn_type in ('contextfunction', + 'evalcontextfunction', + 'environmentfunction'): + if hasattr(fn, fn_type): + __obj = fn + break if isinstance(__obj, _context_function_types): if getattr(__obj, 'contextfunction', 0): -- cgit v1.2.1