Rollup merge of #137968 - dingxiangfei2009:patch-1, r=Mark-Simulacrum
Properly escape regexes in Python scripts According to the [Python 3.12 release note](https://docs.python.org/3/whatsnew/3.12.html#other-language-changes) string literals containing typical invalid escape sequences like `"\d"` are now rejected. There seems to remain only two instances of escape sequences in regex. This change will allow us to work with newer Python interpreter.
This commit is contained in:
commit
199e714a66
1 changed files with 2 additions and 2 deletions
|
@ -40,7 +40,7 @@ def print_debug(s):
|
|||
|
||||
def normalize_whitespace(s):
|
||||
"""Replace newlines, tabs, multiple spaces, etc with exactly one space"""
|
||||
return re.sub("\s+", " ", s)
|
||||
return re.sub(r"\s+", " ", s)
|
||||
|
||||
|
||||
def breakpoint_callback(frame, bp_loc, dict):
|
||||
|
@ -234,7 +234,7 @@ try:
|
|||
if (
|
||||
command == "run"
|
||||
or command == "r"
|
||||
or re.match("^process\s+launch.*", command)
|
||||
or re.match(r"^process\s+launch.*", command)
|
||||
):
|
||||
# Before starting to run the program, let the thread sleep a bit, so all
|
||||
# breakpoint added events can be processed
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue