1
0
mirror of https://github.com/ARM-software/workload-automation.git synced 2025-01-18 12:06:08 +00:00

utils/doc: Fix output for lambda function

The "name" can be in the format "<class>.<lambda>" so
update to allow correct function with the updated format.
This commit is contained in:
Marc Bonnici 2020-11-13 16:18:47 +00:00 committed by setrofim
parent 76032c1d05
commit 8e56a4c831

View File

@ -62,7 +62,7 @@ def get_type_name(obj):
elif match.group(1) == 'function':
text = str(obj)
name = text.split()[1]
if name == '<lambda>':
if name.endswith('<lambda>'):
source = inspect.getsource(obj).strip().replace('\n', ' ')
match = re.search(r'lambda\s+(\w+)\s*:\s*(.*?)\s*[\n,]', source)
if not match: