]> git.ipfire.org Git - thirdparty/jinja.git/commitdiff
Removed an unnecessary check
authorArmin Ronacher <armin.ronacher@active-4.com>
Mon, 20 May 2013 01:12:34 +0000 (02:12 +0100)
committerArmin Ronacher <armin.ronacher@active-4.com>
Mon, 20 May 2013 01:12:34 +0000 (02:12 +0100)
jinja2/runtime.py

index 14162e67ca9a66e61564eb077b53b2a665d6cf92..71485c8f40feb0dcb3b20d946fe50697a8c21449 100644 (file)
@@ -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):