Skip to content

Commit

Permalink
Fix invalid escape sequences
Browse files Browse the repository at this point in the history
  • Loading branch information
grossmj committed Apr 23, 2024
1 parent 1414bdc commit 18002a7
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion gns3server/compute/qemu/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -226,7 +226,7 @@ async def get_qemu_version(qemu_path):
else:
try:
output = await subprocess_check_output(qemu_path, "-version", "-nographic")
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
Expand Down
2 changes: 1 addition & 1 deletion gns3server/compute/vmware/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -701,7 +701,7 @@ def get_vmware_default_vm_paths():
path = ctypes.create_unicode_buffer(ctypes.wintypes.MAX_PATH)
ctypes.windll.shell32.SHGetFolderPathW(None, 5, None, 0, path)
documents_folder = path.value
return ['{}\My Virtual Machines'.format(documents_folder), '{}\Virtual Machines'.format(documents_folder)]
return [r'{}\My Virtual Machines'.format(documents_folder), r'{}\Virtual Machines'.format(documents_folder)]
elif sys.platform.startswith("darwin"):
return [os.path.expanduser("~/Documents/Virtual Machines.localized")]
else:
Expand Down
2 changes: 1 addition & 1 deletion gns3server/utils/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ def parse_version(version):
"""

release_type_found = False
version_infos = re.split('(\.|[a-z]+)', version)
version_infos = re.split(r'(\.|[a-z]+)', version)
version = []
for info in version_infos:
if info == '.' or len(info) == 0:
Expand Down
4 changes: 2 additions & 2 deletions gns3server/utils/interfaces.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ def _get_windows_interfaces_from_registry():
hkeycard = winreg.OpenKey(hkey, network_card_id)
guid, _ = winreg.QueryValueEx(hkeycard, "ServiceName")
netcard, _ = winreg.QueryValueEx(hkeycard, "Description")
connection = r"SYSTEM\CurrentControlSet\Control\Network\{4D36E972-E325-11CE-BFC1-08002BE10318}" + "\{}\Connection".format(guid)
connection = r"SYSTEM\CurrentControlSet\Control\Network\{4D36E972-E325-11CE-BFC1-08002BE10318}" + r"\{}\Connection".format(guid)
hkeycon = winreg.OpenKey(winreg.HKEY_LOCAL_MACHINE, connection)
name, _ = winreg.QueryValueEx(hkeycon, "Name")
interface = r"SYSTEM\CurrentControlSet\Services\Tcpip\Parameters\Interfaces\{}".format(guid)
Expand Down Expand Up @@ -92,7 +92,7 @@ def get_windows_interfaces():
interfaces = []
try:
locator = win32com.client.Dispatch("WbemScripting.SWbemLocator")
service = locator.ConnectServer(".", "root\cimv2")
service = locator.ConnectServer(".", r"root\cimv2")
network_configs = service.InstancesOf("Win32_NetworkAdapterConfiguration")
# more info on Win32_NetworkAdapter: http://msdn.microsoft.com/en-us/library/aa394216%28v=vs.85%29.aspx
for adapter in service.InstancesOf("Win32_NetworkAdapter"):
Expand Down

0 comments on commit 18002a7

Please sign in to comment.