void-packages/srcpkgs/safeeyes/patches/fix-python3.12-importlib.patch

29 lines
696 B
Diff

diff --git a/safeeyes/utility.py b/safeeyes/utility.py
index 76803e5..ad35134 100644
--- a/safeeyes/utility.py
+++ b/safeeyes/utility.py
@@ -21,9 +21,9 @@ This module contains utility functions for Safe Eyes and its plugins.
"""
import errno
-import imp
import inspect
import importlib
+import importlib.util
import json
import locale
import logging
@@ -354,11 +354,7 @@ def module_exist(module):
"""
Check wther the given Python module exists or not.
"""
- try:
- imp.find_module(module)
- return True
- except ImportError:
- return False
+ return importlib.util.find_spec(module) is not None
def merge_configs(new_config, old_config):