Skip to content

Commit

Permalink
llext_link_helper.py: use a raw string for '\.so$' regex
Browse files Browse the repository at this point in the history
Always use a "raw string" for regular expressions, otherwise the
backslash is used to start Unicode escape sequences.

Fixes hopefully harmless error:
```
scripts/llext_link_helper.py:38: SyntaxWarning: invalid escape sequence '\.'
  p = re.compile('(^lib|\.so$)')
```

Signed-off-by: Marc Herbert <marc.herbert@intel.com>
  • Loading branch information
marc-hb committed May 7, 2024
1 parent 4bc614c commit a088dd6
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion scripts/llext_link_helper.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ def main():
elf = ELFFile(open(args.file, 'rb'))

text_addr = int(args.text_addr, 0)
p = re.compile('(^lib|\.so$)')
p = re.compile(r'(^lib|\.so$)')
module = p.sub('', args.file)

if elf.num_segments() != 0:
Expand Down

0 comments on commit a088dd6

Please sign in to comment.