From: Stephen Finucane Date: Sat, 30 Nov 2019 15:40:15 +0000 (+0000) Subject: parser: Fix style issues X-Git-Tag: v2.2.0-rc1~25 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=3ed6a1434dd90f073f5db5a6e85a80469aaaed40;p=thirdparty%2Fpatchwork.git parser: Fix style issues Signed-off-by: Stephen Finucane Fixes: 8c229caa ("Improve pull request URL matching regex") --- diff --git a/patchwork/parser.py b/patchwork/parser.py index d25c0df3..c424729b 100644 --- a/patchwork/parser.py +++ b/patchwork/parser.py @@ -937,13 +937,14 @@ def parse_patch(content): def parse_pull_request(content): - git_re = re.compile(r'^The following changes since commit.*' - r'^are available in the git repository at:\n' - r'^\s*([\w+-]+(?:://|@)[\w/.@:~-]+[\s\\]*[\w/._-]*)\s*$', - re.DOTALL | re.MULTILINE | re.IGNORECASE) + git_re = re.compile( + r'^The following changes since commit.*' + r'^are available in the git repository at:\n' + r'^\s*([\w+-]+(?:://|@)[\w/.@:~-]+[\s\\]*[\w/._-]*)\s*$', + re.DOTALL | re.MULTILINE | re.IGNORECASE) match = git_re.search(content) if match: - return re.sub('\s+', ' ', match.group(1)).strip() + return re.sub(r'\s+', ' ', match.group(1)).strip() return None