mirror of
https://github.com/GNS3/gns3-server.git
synced 2026-11-06 07:11:13 +02:00
Fix DeprecationWarning: invalid escape sequence. Fixes https://github.com/GNS3/gns3-gui/issues/2670
This commit is contained in:
1 parent
4b52e9313e
commit
456ef1348b
9 files changed
+23
-23
No files matched your search
@@ -177,7 +177,7 @@ class Qemu(BaseManager):
|
||||
try:
|
||||
with open(version_file, "rb") as file:
|
||||
version = file.read().decode("utf-8").strip()
|
||||
match = re.search("[0-9\.]+", version)
|
||||
match = re.search(r"[0-9\.]+", version)
|
||||
if match:
|
||||
return version
|
||||
except (UnicodeDecodeError, OSError) as e:
|
||||
@@ -186,7 +186,7 @@ class Qemu(BaseManager):
|
||||
else:
|
||||
try:
|
||||
output = await subprocess_check_output(qemu_path, "-version")
|
||||
match = re.search("version\s+([0-9a-z\-\.]+)", output)
|
||||
match = re.search(r"version\s+([0-9a-z\-\.]+)", output)
|
||||
if match:
|
||||
version = match.group(1)
|
||||
return version
|
||||
@@ -205,7 +205,7 @@ class Qemu(BaseManager):
|
||||
|
||||
try:
|
||||
output = await subprocess_check_output(qemu_img_path, "--version")
|
||||
match = re.search("version\s+([0-9a-z\-\.]+)", output)
|
||||
match = re.search(r"version\s+([0-9a-z\-\.]+)", output)
|
||||
if match:
|
||||
version = match.group(1)
|
||||
return version
|
||||
|
||||
Reference in new issue
Block a user