summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJan Pokorný <jpokorny@redhat.com>2015-07-13 23:00:38 +0200
committerJan Pokorný <jpokorny@redhat.com>2015-07-14 19:49:08 +0200
commit4884c74625c1fec7fe2315cbb2ea50b4d0cc991b (patch)
tree0768c4d10805290fafb126c31945e93e414682dd
parentaa9154ea51152de56d8eaa825f1ab23a62d44ec6 (diff)
downloadclufter-4884c74625c1fec7fe2315cbb2ea50b4d0cc991b.tar.gz
clufter-4884c74625c1fec7fe2315cbb2ea50b4d0cc991b.tar.xz
clufter-4884c74625c1fec7fe2315cbb2ea50b4d0cc991b.zip
format: avoid duplicate "swallow" (+validation, ...)
Also fixes assertion error for two equal (but non-identical) tuples later on. Signed-off-by: Jan Pokorný <jpokorny@redhat.com>
-rw-r--r--format.py3
1 files changed, 2 insertions, 1 deletions
diff --git a/format.py b/format.py
index d79c174..73b4c7e 100644
--- a/format.py
+++ b/format.py
@@ -308,7 +308,8 @@ class Format(object):
produced = producer(protocol, *args, **kwargs)
if produced is None:
continue
- if that_cls is self.__class__:
+ if (that_cls is self.__class__
+ and protocol not in self._representations):
# computed -> stored normalization
self.swallow(protocol, *arg2wrapped(produced))
else: