Mercurial > public > mercurial-scm > hg-stable
diff mercurial/crecord.py @ 41549:7a90ff8cd14c
crecord: use raw string for regular expression
\s emits a SyntaxWarning in Python 3.8. Use a raw string to
avoid escaping the \.
Differential Revision: https://phab.mercurial-scm.org/D5819
author | Gregory Szorc <gregory.szorc@gmail.com> |
---|---|
date | Mon, 04 Feb 2019 09:00:52 -0800 |
parents | 5c73441a47e5 |
children | 7c4e205f71ca |
line wrap: on
line diff
--- a/mercurial/crecord.py Mon Feb 04 08:59:11 2019 -0800 +++ b/mercurial/crecord.py Mon Feb 04 09:00:52 2019 -0800 @@ -1799,6 +1799,7 @@ break if self.commenttext != "": - whitespaceremoved = re.sub("(?m)^\s.*(\n|$)", "", self.commenttext) + whitespaceremoved = re.sub(br"(?m)^\s.*(\n|$)", b"", + self.commenttext) if whitespaceremoved != "": self.opts['message'] = self.commenttext