#106: add callable to check if it is function

This commit is contained in:
debugtalk
2018-03-01 00:13:25 +08:00
parent f1cac82a15
commit f95351cc6e

View File

@@ -705,8 +705,13 @@ class TestcaseParser(object):
return self.functions[item_name]
try:
return eval(item_name)
except NameError:
# check if builtin functions
item_func = eval(item_name)
if callable(item_func):
# is builtin function
return item_func
except (NameError, TypeError):
# is not builtin function, continue to search
pass
elif item_type == "variable":
if item_name in self.variables: