Skip to content

Commit 7d4a8d9

Browse files
committed
GetFunctionInfo: check iscallable instead of list of callable types
1 parent 3b8088a commit 7d4a8d9

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

isc/py/Main.cls

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -333,7 +333,11 @@ ClassMethod GetFunctionInfo(function As %String = "", Output defined As %Boolean
333333
quit:$$$ISERR(sc) sc
334334
quit:'defined $$$ERROR($$$GeneralError, "Function is not defined: " _ function)
335335
quit:type="type" ..GetFunctionInfo(function _ ".__init__", .defined, .type, .docs, .signature, .arguments) // for classes get constructor
336-
quit:((type'="function") && (type'="method") && (type'="builtin_function_or_method") && (type'="method_descriptor")) $$$ERROR($$$FormatText("%1 is not a function/method, but a %2", function, type))
336+
337+
set sc = ..SimpleString("zzziscallable=callable(" _ function _ ")", "zzziscallable", ,.iscallable)
338+
quit:$$$ISERR(sc) sc
339+
set iscallable = ##class(isc.py.util.Converter).PythonToBoolean(iscallable)
340+
quit:'iscallable $$$ERROR($$$FormatText("%1 is not callable, with type: %2", function, type))
337341

338342
if defined {
339343
set sc = ..ImportModule("inspect", , .inspect)

0 commit comments

Comments
 (0)