mirror of
https://github.com/ARM-software/workload-automation.git
synced 2025-01-18 20:11:20 +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:
parent
76032c1d05
commit
8e56a4c831
@ -62,7 +62,7 @@ def get_type_name(obj):
|
|||||||
elif match.group(1) == 'function':
|
elif match.group(1) == 'function':
|
||||||
text = str(obj)
|
text = str(obj)
|
||||||
name = text.split()[1]
|
name = text.split()[1]
|
||||||
if name == '<lambda>':
|
if name.endswith('<lambda>'):
|
||||||
source = inspect.getsource(obj).strip().replace('\n', ' ')
|
source = inspect.getsource(obj).strip().replace('\n', ' ')
|
||||||
match = re.search(r'lambda\s+(\w+)\s*:\s*(.*?)\s*[\n,]', source)
|
match = re.search(r'lambda\s+(\w+)\s*:\s*(.*?)\s*[\n,]', source)
|
||||||
if not match:
|
if not match:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user