File virtinst-drop-removeprefix-usage.patch of Package virt-manager
References: bsc#1234215
Index: virt-manager-5.0.0/virtinst/devices/disk.py
===================================================================
--- virt-manager-5.0.0.orig/virtinst/devices/disk.py
+++ virt-manager-5.0.0/virtinst/devices/disk.py
@@ -678,7 +678,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(