Skip to content

Commit c3712f2

Browse files
committed
Remove minor bug from optimization in python loader.
1 parent 4f3832c commit c3712f2

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

source/loaders/py_loader/source/py_loader_impl.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1001,7 +1001,8 @@ value py_loader_impl_capi_to_value(loader_impl impl, PyObject *obj, type_id id)
10011001
}
10021002
else if (id == TYPE_FUNCTION)
10031003
{
1004-
/* Check if we are passing our own hook to the callback */
1004+
/* Check if we are passing our own hook to the callback */
1005+
#if 0 /* TODO: This optimization does not work properly (check metacall-node-port-test for implementing it) */
10051006
if (PyCFunction_Check(obj) && PyCFunction_GET_FUNCTION(obj) == py_loader_impl_function_type_invoke)
10061007
{
10071008
PyObject *invoke_state_capsule = PyCFunction_GET_SELF(obj);
@@ -1017,6 +1018,7 @@ value py_loader_impl_capi_to_value(loader_impl impl, PyObject *obj, type_id id)
10171018

10181019
return callback;
10191020
}
1021+
#endif
10201022

10211023
loader_impl_py py_impl = loader_impl_get(impl);
10221024
size_t args_count = py_loader_impl_discover_callable_args_count(py_impl, obj);

0 commit comments

Comments
 (0)