Skip to content
Commit 7b8f0bfa authored by Brian Norris's avatar Brian Norris Committed by Simon Glass
Browse files

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: default avatarBrian Norris <computersforpeace@gmail.com>
Reviewed-by: default avatarSimon Glass <sjg@chromium.org>
parent 57949a99
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment