Commit 12809e16 authored by Tim Graham's avatar Tim Graham
Browse files

Fixed #23489 -- Added numpy 1.9+ support in template lookups

parent 054bdfef
Loading
Loading
Loading
Loading
+3 −1
Original line number Diff line number Diff line
@@ -767,7 +767,9 @@ class Variable(object):
            for bit in self.lookups:
                try:  # dictionary lookup
                    current = current[bit]
                except (TypeError, AttributeError, KeyError, ValueError):
                    # ValueError/IndexError are for numpy.array lookup on
                    # numpy < 1.9 and 1.9+ respectively
                except (TypeError, AttributeError, KeyError, ValueError, IndexError):
                    try:  # attribute lookup
                        # Don't return class attributes if the class is the context:
                        if isinstance(current, BaseContext) and getattr(type(current), bit):