aboutsummaryrefslogtreecommitdiff
path: root/gcc/gdbhooks.py
diff options
context:
space:
mode:
authorJason Merrill <jason@redhat.com>2024-02-05 11:49:41 -0500
committerJason Merrill <jason@redhat.com>2024-02-16 11:07:38 -0500
commit945cb8490cbdb558e010878f2fb70f5ef088d7ec (patch)
tree92432aa34f411d2a1b9e7cdc4fde0289afabab6f /gcc/gdbhooks.py
parent83aaa1079c2449b275ea2426699555dbb0118e72 (diff)
downloadgcc-945cb8490cbdb558e010878f2fb70f5ef088d7ec.zip
gcc-945cb8490cbdb558e010878f2fb70f5ef088d7ec.tar.gz
gcc-945cb8490cbdb558e010878f2fb70f5ef088d7ec.tar.bz2
gdbhooks: regex syntax error
Recent python complains about this pattern with SyntaxWarning: invalid escape sequence '\s' because \s in a regular string just means 's'; for it to mean whitespace, you need \\ or for the pattern to be a raw string. Curiously, break-on-pass completion works for me either with or without this change, but at least this avoids the warning. gcc/ChangeLog: * gdbhooks.py: Fix regex syntax.
Diffstat (limited to 'gcc/gdbhooks.py')
-rw-r--r--gcc/gdbhooks.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/gcc/gdbhooks.py b/gcc/gdbhooks.py
index 3fa6265..92e3888 100644
--- a/gcc/gdbhooks.py
+++ b/gcc/gdbhooks.py
@@ -642,7 +642,7 @@ class PassNames:
self.names = []
with open(os.path.join(srcdir, 'passes.def')) as f:
for line in f:
- m = re.match('\s*NEXT_PASS \(([^,]+).*\);', line)
+ m = re.match(r'\s*NEXT_PASS \(([^,]+).*\);', line)
if m:
self.names.append(m.group(1))