File 071-createvm-Replace-deprecated-pkgutil.find_loader.patch of Package virt-manager
Subject: createvm: Replace deprecated pkgutil.find_loader
From: Cole Robinson crobinso@redhat.com Sun Mar 3 10:23:33 2024 -0500
Date: Sun Mar 3 10:43:30 2024 -0500:
Git: a52ab24ec4b8f036038e4488255792f553931c6a
importlib.util.find_spec is around since python 3.4
Signed-off-by: Cole Robinson <crobinso@redhat.com>
diff --git a/virtManager/createvm.py b/virtManager/createvm.py
index 95aff71b..b352739d 100644
--- a/virtManager/createvm.py
+++ b/virtManager/createvm.py
@@ -4,8 +4,8 @@
# This work is licensed under the GNU GPLv2 or later.
# See the COPYING file in the top-level directory.
+import importlib
import io
-import pkgutil
import os
import threading
import time
@@ -79,7 +79,7 @@ def _pretty_memory(mem):
###########################################################
def is_virt_bootstrap_installed(conn):
- ret = pkgutil.find_loader('virtBootstrap') is not None
+ ret = importlib.util.find_spec('virtBootstrap') is not None
return ret or conn.config.CLITestOptions.fake_virtbootstrap