1
0
mirror of https://github.com/rkd77/elinks.git synced 2024-12-04 14:46:47 -05:00

[python] module imp is deprecated. Refs #313

(cherry picked from commit 2577da8942)
This commit is contained in:
Witold Filipczyk 2024-06-10 13:07:23 +02:00
parent 5975184c90
commit 504fdbe340

View File

@ -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;