Started to work on Python 3 support.
--HG--
branch : trunk
diff --git a/jinja2/tests.py b/jinja2/tests.py
index 58dc0c0..9fbf163 100644
--- a/jinja2/tests.py
+++ b/jinja2/tests.py
@@ -16,6 +16,13 @@
regex_type = type(number_re)
+try:
+ test_callable = callable
+except NameError:
+ def test_callable(x):
+ return hasattr(x, '__call__')
+
+
def test_odd(value):
"""Return true if the variable is odd."""
return value % 2 == 1
@@ -130,7 +137,7 @@
'number': test_number,
'sequence': test_sequence,
'iterable': test_iterable,
- 'callable': callable,
+ 'callable': test_callable,
'sameas': test_sameas,
'escaped': test_escaped
}