Fix DeprecationWarning: invalid escape sequence. Fixes https://github.com/GNS3/gns3-gui/issues/2670

This commit is contained in:
grossmj committed 2019-01-17 18:01:58 +07:00
1 parent 4b52e9313e
commit 456ef1348b
9 files changed
+23 -23

No files matched your search

+3 -3
View File
@@ -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