Skip to content

Commit

Permalink
[python] module imp is deprecated. Refs #313
Browse files Browse the repository at this point in the history
  • Loading branch information
rkd77 committed Jun 10, 2024
1 parent 06e334e commit 2577da8
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/scripting/python/core.c
Original file line number Diff line number Diff line change
Expand Up @@ -138,10 +138,10 @@ hooks_module_exists(void)
* indicates that no such module was found; any other exception will
* be reported as an error.
*/
imp_module = PyImport_ImportModule("imp");
imp_module = PyImport_ImportModule("importlib.util");
if (!imp_module) goto python_error;

result = PyObject_CallMethod(imp_module, "find_module", "s", "hooks");
result = PyObject_CallMethod(imp_module, "find_spec", "s", "hooks");
if (result) {
found_hooks = 1;
goto end;
Expand Down

0 comments on commit 2577da8

Please sign in to comment.