Skip to content

Commit 63edeb5

Browse files
committed
Fix set_reflash_callback since icsneoSetReflashCallback has a void return type
1 parent b108b67 commit 63edeb5

1 file changed

Lines changed: 2 additions & 8 deletions

File tree

src/methods.cpp

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2141,15 +2141,9 @@ PyObject* meth_set_reflash_callback(PyObject* self, PyObject* args)
21412141
lib, "icsneoSetReflashCallback");
21422142
auto gil = PyAllowThreads();
21432143
if (callback == Py_None) {
2144-
if (!icsneoSetReflashCallback(NULL)) {
2145-
gil.restore();
2146-
return set_ics_exception(exception_runtime_error(), "icsneoSetReflashCallback() Failed");
2147-
}
2144+
icsneoSetReflashCallback(NULL);
21482145
} else {
2149-
if (!icsneoSetReflashCallback(&message_reflash_callback)) {
2150-
gil.restore();
2151-
return set_ics_exception(exception_runtime_error(), "icsneoSetReflashCallback() Failed");
2152-
}
2146+
icsneoSetReflashCallback(&message_reflash_callback);
21532147
}
21542148
gil.restore();
21552149
Py_RETURN_NONE;

0 commit comments

Comments
 (0)