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
This commit is contained in:
Zane Bitter 2018-08-02 10:55:43 -04:00
parent 33c5b6129a
commit bcd430cf4d
1 changed files with 2 additions and 1 deletions

View File

@ -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)