mirror of
https://github.com/u-boot/u-boot.git
synced 2025-05-08 19:11:53 +00:00
patman: Resolve python string vs. regex escaping syntax
Python strings have their own notion of backslash-escaping, and that can conflict with the intentions for strings passed to the 're' module. In particular, I get warnings like this: tools/patman/../patman/commit.py:9: SyntaxWarning: invalid escape sequence '\s' re_subject_tag = re.compile('([^:\s]*):\s*(.*)') We should use a raw string (r'...') so that all escaping is passed into the regex module, not interpreted within the string itself. Signed-off-by: Brian Norris <computersforpeace@gmail.com> Reviewed-by: Simon Glass <sjg@chromium.org>
This commit is contained in:
parent
57949a99b7
commit
7b8f0bfa6e
2 changed files with 2 additions and 2 deletions
|
@ -6,7 +6,7 @@ import collections
|
|||
import re
|
||||
|
||||
# Separates a tag: at the beginning of the subject from the rest of it
|
||||
re_subject_tag = re.compile('([^:\s]*):\s*(.*)')
|
||||
re_subject_tag = re.compile(r'([^:\s]*):\s*(.*)')
|
||||
|
||||
class Commit:
|
||||
"""Holds information about a single commit/patch in the series.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue