Remove pointless callable checks on known functions
@@ -260,11 +260,6 @@ extern "C" int embed_sim_init(int argc, char const * const * argv)
LOG_ERROR("Failed to get the _log_from_c function");
goto cleanup;
}
- if (!PyCallable_Check(simlog_func)) {
- LOG_ERROR("_log_from_c is not callable");
- Py_DECREF(simlog_func);
- goto cleanup;
- }
set_log_handler(simlog_func); // Note: This function steals a reference to simlog_func.
@@ -275,11 +270,6 @@ extern "C" int embed_sim_init(int argc, char const * const * argv)
LOG_ERROR("Failed to get the _filter_from_c method");
goto cleanup;
}
- if (!PyCallable_Check(simlog_func)) {
- LOG_ERROR("_filter_from_c is not callable");
- Py_DECREF(simlog_func);
- goto cleanup;
- }
set_log_filter(simlog_func); // Note: This function steals a reference to simlog_func.
@@ -289,12 +279,6 @@ extern "C" int embed_sim_init(int argc, char const * const * argv)
LOG_ERROR("Failed to get the _sim_event method");
goto cleanup;
}
- if (!PyCallable_Check(pEventFn)) {
- LOG_ERROR("cocotb._sim_event is not callable");
- Py_DECREF(pEventFn);
- pEventFn = NULL;
- goto cleanup;
- }
cocotb_init = PyObject_GetAttrString(cocotb_module, "_initialise_testbench"); // New reference
if (cocotb_init == NULL) {
@@ -302,11 +286,6 @@ extern "C" int embed_sim_init(int argc, char const * const * argv)
LOG_ERROR("Failed to get the _initialise_testbench method");
goto cleanup;
}
- if (!PyCallable_Check(cocotb_init)) {
- LOG_ERROR("cocotb._initialise_testbench is not callable");
- Py_DECREF(cocotb_init);
- goto cleanup;
- }
// Build argv for cocotb module
argv_list = PyList_New(argc); // New reference
