From bcd430cf4db77d6aefacf8145a53fd235c19e04c Mon Sep 17 00:00:00 2001 From: Zane Bitter Date: Thu, 2 Aug 2018 10:55:43 -0400 Subject: [PATCH] Fix errors with issubclass() in Python 3.7 The cfn Ref instrinsic function is implemented as a Python function rather than a class, so calling issubclass() on it fails in Python 3.7. Change-Id: I3f826cd8f024b591d7c3b41ad1e3f960558d3f9b --- heat/engine/template.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/heat/engine/template.py b/heat/engine/template.py index 5f7065622c..83d3d6f25c 100644 --- a/heat/engine/template.py +++ b/heat/engine/template.py @@ -366,7 +366,8 @@ def parse(functions, stack, snippet, path='', template=None): if Func is not None: try: path = '.'.join([path, fn_name]) - if issubclass(Func, function.Macro): + if (isinstance(Func, type) and + issubclass(Func, function.Macro)): return Func(stack, fn_name, args, functools.partial(recurse, path=path), template)