Skip to content

Commit

Permalink
print-tock-memory-usage.py: fix regex warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
hudson-ayers committed Mar 1, 2024
1 parent dacf18b commit 751d49a
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions tools/print_tock_memory_usage.py
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ def process_section_line(line):
"""Parses a line from the Sections: header of an ELF objdump,
inserting it into a data structure keeping track of the sections."""
# pylint: disable=anomalous-backslash-in-string,line-too-long
match = re.search("^\S+\s+\.(text|relocate|sram|stack|app_memory)\s+(\S+).+", line)
match = re.search(r"^\S+\s+\.(text|relocate|sram|stack|app_memory)\s+(\S+).+", line)
if match != None:
sections[match.group(1)] = int(match.group(2), 16)

Expand Down Expand Up @@ -244,7 +244,7 @@ def process_symbol_line(line):
global kernel_initialized
global kernel_uninitialized
match = re.search(
"^(\S+)\s+(\w*)\s+(\w*)\s+\.(text|relocate|sram|stack|app_memory)\s+(\S+)\s+(.+)",
r"^(\S+)\s+(\w*)\s+(\w*)\s+\.(text|relocate|sram|stack|app_memory)\s+(\S+)\s+(.+)",
line,
)
if match != None:
Expand Down Expand Up @@ -278,7 +278,7 @@ def process_symbol_line(line):

# Code and embedded data.
elif segment == "text":
match = re.search("\$(((\w+\.\.)+)(\w+))\$", name)
match = re.search(r"\$(((\w+\.\.)+)(\w+))\$", name)
# It's a function
if is_private_symbol(name):
# Skip this symbol
Expand Down Expand Up @@ -659,7 +659,7 @@ def parse_options(opts):

for hline in header_lines:
# pylint: disable=anomalous-backslash-in-string
hmatch = re.search("file format (\S+)", hline)
hmatch = re.search(r"file format (\S+)", hline)
if hmatch != None:
arch = hmatch.group(1)

Expand Down

0 comments on commit 751d49a

Please sign in to comment.