From d6cc0b0910197e3455f56bc487e5cc1fae8aef6c Mon Sep 17 00:00:00 2001 From: Michael Buesch Date: Tue, 15 May 2018 21:46:46 +0200 Subject: Treat variables that expand to None as non-existing Signed-off-by: Michael Buesch --- cms/cms.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/cms/cms.py b/cms/cms.py index 7a29a86..89fc5a6 100644 --- a/cms/cms.py +++ b/cms/cms.py @@ -484,10 +484,10 @@ class CMSStatementResolver(object): def expandVariable(self, name): try: value = self.variables[name] - try: + if callable(value): value = value(self, name) - except (TypeError) as e: - pass + if value is None: + raise KeyError return str(value) except (KeyError, TypeError) as e: return "" -- cgit v1.2.3