File virtinst-drop-removeprefix-usage.patch of Package virt-manager

References: bsc#1234215

Index: virt-manager-5.1.0/virtinst/devices/disk.py
===================================================================
--- virt-manager-5.1.0.orig/virtinst/devices/disk.py
+++ virt-manager-5.1.0/virtinst/devices/disk.py
@@ -703,7 +703,10 @@ class DeviceDisk(Device):
         # Some file managers use 'file://' when passing files to
         # virt-manager, we need to strip it from the newpath.
         if newpath is not None:
-            newpath = newpath.removeprefix("file://")
+            # str.removeprefix(prefix, /) available in python 3.9 or newer
+            prefix = "file://"
+            if newpath.startswith(prefix):
+                newpath = newpath[len(prefix):]
 
         if self._storage_backend.will_create_storage():
             raise xmlutil.DevError("Can't change disk path if storage creation info has been set.")
openSUSE Build Service is sponsored by