From b32b6822e501b863e40ca431102d4f59f8573216 Mon Sep 17 00:00:00 2001 From: Stuart Archibald Date: Tue, 5 Dec 2023 12:23:39 +0000 Subject: [PATCH] Add fixes for syntax warnings in numba/misc. As title. --- numba/misc/gdb_print_extension.py | 2 +- numba/misc/llvm_pass_timings.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/numba/misc/gdb_print_extension.py b/numba/misc/gdb_print_extension.py index 7dd76c94ca9..982aacf26e5 100644 --- a/numba/misc/gdb_print_extension.py +++ b/numba/misc/gdb_print_extension.py @@ -55,7 +55,7 @@ def to_string(self): # NOTE: need to deal with "Alignment" else dtype size is wrong arr_info = [x.strip() for x in matcher.match(ty_str).groups()] dtype_str, ndim_str, order_str = arr_info - rstr = 'Record\\((.*\\[.*\\]);([0-9]+);(True|False)' + rstr = r'Record\((.*\[.*\]);([0-9]+);(True|False)' rstr_match = re.match(rstr, dtype_str) # balign is unused, it's the alignment fields, balign, is_aligned_str = rstr_match.groups() diff --git a/numba/misc/llvm_pass_timings.py b/numba/misc/llvm_pass_timings.py index 427d0e202fa..17c52dbf483 100644 --- a/numba/misc/llvm_pass_timings.py +++ b/numba/misc/llvm_pass_timings.py @@ -239,7 +239,7 @@ def parse(raw_data): else: attrs.append(f"{k}_time") attrs.append(f"{k}_percent") - pat += f"\\s+(?:{n}\\s*\\({n}%\\)|-+)" + pat += rf"\s+(?:{n}\s*\({n}%\)|-+)" # put default value 0.0 to all missing attributes missing = {}