scripts/pretty_print_stacks.py: Silence warning from Python 3.12
PATCH v2 1/1 scripts/pretty_print_stacks.py: Silence warning from Python 3.12
Python 3.12 complains:
./scripts/pretty_print_stacks.py:41: SyntaxWarning:
invalid escape sequence '\?'
m = re.match(b'(.*) at (.*):(([0-9]+)|\?)([^:]*)', line)
Switch to a raw byte string to silence the problem.
Signed-off-by Thomas Huth <[email protected]>
---
v2: Use "rb" prefix
scripts/pretty_print_stacks.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
scripts/pretty_print_stacks.py +1 -1
@@ -38,7 +38,7 @@ def pretty_print_stack(binary, line): return for line in out.splitlines(): - m = re.match(b'(.*) at (.*):(([0-9]+)|\?)([^:]*)', line) + m = re.match(rb'(.*) at (.*):(([0-9]+)|\?)([^:]*)', line) if m is None: puts('%s\n' % line) return
Signature · 1 line
2.43.0
Quoted 9 lines · Thomas Huth
Python 3.12 complains:
./scripts/pretty_print_stacks.py:41: SyntaxWarning:
invalid escape sequence '\?'
m =re.match(b'(.*) at (.*):(([0-9]+)|\?)([^:]*)', line)Switch to a raw byte string to silence the problem.
Signed-off-by Thomas Huth <[email protected]>
Reviewed-by Nina Schoetterl-Glausch <[email protected]>
Quoted 19 lines
---
v2: Use "rb" prefixscripts/pretty_print_stacks.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)scripts/pretty_print_stacks.py +1
-1@@ -38,7 +38,7 @@ def pretty_print_stack(binary, line): return for line in out.splitlines(): - m = re.match(b'(.*) at (.*):(([0-9]+)|\?)([^:]*)', line) + m = re.match(rb'(.*) at (.*):(([0-9]+)|\?)([^:]*)', line) if m is None: puts('%s\n' % line) return