[Lldb-commits] [lldb] [lldb] Fixed SyntaxWarning: invalid escape sequence \[ \d \s (PR #91146)

Dmitry Vasilyev via lldb-commits lldb-commits at lists.llvm.org
Mon May 6 15:52:31 PDT 2024


https://github.com/slydiman updated https://github.com/llvm/llvm-project/pull/91146

>From c7cef45aa369014650cc99d404913c17cb3c1d45 Mon Sep 17 00:00:00 2001
From: Dmitry Vasilyev <dvassiliev at accesssoftek.com>
Date: Mon, 6 May 2024 01:10:03 +0400
Subject: [PATCH] [lldb] Fixed SyntaxWarning: invalid escape sequence \[ \d \s

Reproduced with Python 3.12.3
---
 .../lldbsuite/test/tools/lldb-server/gdbremote_testcase.py    | 4 ++--
 .../lldbsuite/test/tools/lldb-server/lldbgdbserverutils.py    | 2 +-
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/lldb/packages/Python/lldbsuite/test/tools/lldb-server/gdbremote_testcase.py b/lldb/packages/Python/lldbsuite/test/tools/lldb-server/gdbremote_testcase.py
index 75522158b32210..8c8e4abed0b454 100644
--- a/lldb/packages/Python/lldbsuite/test/tools/lldb-server/gdbremote_testcase.py
+++ b/lldb/packages/Python/lldbsuite/test/tools/lldb-server/gdbremote_testcase.py
@@ -130,9 +130,9 @@ def setUp(self):
         self.stub_sends_two_stop_notifications_on_kill = False
         if configuration.lldb_platform_url:
             if configuration.lldb_platform_url.startswith("unix-"):
-                url_pattern = "(.+)://\[?(.+?)\]?/.*"
+                url_pattern = r"(.+)://\[?(.+?)\]?/.*"
             else:
-                url_pattern = "(.+)://(.+):\d+"
+                url_pattern = r"(.+)://(.+):\d+"
             scheme, host = re.match(
                 url_pattern, configuration.lldb_platform_url
             ).groups()
diff --git a/lldb/packages/Python/lldbsuite/test/tools/lldb-server/lldbgdbserverutils.py b/lldb/packages/Python/lldbsuite/test/tools/lldb-server/lldbgdbserverutils.py
index 61c5c3a7c865a2..d1a4119bac7815 100644
--- a/lldb/packages/Python/lldbsuite/test/tools/lldb-server/lldbgdbserverutils.py
+++ b/lldb/packages/Python/lldbsuite/test/tools/lldb-server/lldbgdbserverutils.py
@@ -50,7 +50,7 @@ def get_debugserver_exe():
 
 
 _LOG_LINE_REGEX = re.compile(
-    r"^(lldb-server|debugserver)\s+<\s*(\d+)>" + "\s+(read|send)\s+packet:\s+(.+)$"
+    r"^(lldb-server|debugserver)\s+<\s*(\d+)>\s+(read|send)\s+packet:\s+(.+)$"
 )
 
 



More information about the lldb-commits mailing list