From acadd1476d45126a8b7eb4b9a8ac4e1e1faa6478 Mon Sep 17 00:00:00 2001 From: Christoph Sieghart Date: Tue, 21 Jan 2014 20:19:21 +0100 Subject: Fix bug in LazyStub.__getattr__ When run with optimizations turned on, the assert statement is not executed. This results in incorrect behaviour. --- factory/containers.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/factory/containers.py b/factory/containers.py index 7a4c5db..4537e44 100644 --- a/factory/containers.py +++ b/factory/containers.py @@ -103,7 +103,8 @@ class LazyStub(object): if isinstance(val, LazyValue): self.__pending.append(name) val = val.evaluate(self, self.__containers) - assert name == self.__pending.pop() + last = self.__pending.pop() + assert name == last self.__values[name] = val return val else: -- cgit v1.2.3