Fixed a small bug with the undefined object: the error message on divisions with undefined objects was misleading.
--HG--
branch : trunk
diff --git a/jinja2/sandbox.py b/jinja2/sandbox.py
index e9ab1d9..7b28273 100644
--- a/jinja2/sandbox.py
+++ b/jinja2/sandbox.py
@@ -212,14 +212,14 @@
value = getattr(obj, attribute)
except AttributeError:
try:
- return obj[argument]
+ return obj[attribute]
except (TypeError, LookupError):
pass
else:
if self.is_safe_attribute(obj, attribute, value):
return value
return self.unsafe_undefined(obj, attribute)
- return self.undefined(obj=obj, name=argument)
+ return self.undefined(obj=obj, name=attribute)
def unsafe_undefined(self, obj, attribute):
"""Return an undefined object for unsafe attributes."""