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.
This commit is contained in:
Jason Merrill 2024-02-05 11:49:41 -05:00
parent 83aaa1079c
commit 945cb8490c

View file

@ -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))