Skip to content

Commit fe9c028

Browse files
committed
c api check callback func
1 parent 192da4c commit fe9c028

File tree

1 file changed

+4
-0
lines changed
  • dongtai_agent_python/assess_ext

1 file changed

+4
-0
lines changed

dongtai_agent_python/assess_ext/patch.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,10 @@ PyObject *install(PyObject *self, PyObject *arg) {
9191
}
9292

9393
void patch_string_callback(char *prop_method_name, PyObject *source, PyObject *target, PyObject *hook_args, PyObject *hook_kwargs) {
94+
if (!PyObject_HasAttrString(patch_module, prop_method_name)) {
95+
return;
96+
}
97+
9498
PyObject *result;
9599
PyObject *prop_hook_args;
96100
int free_hook_args = 0;

0 commit comments

Comments
 (0)