]> git.ipfire.org Git - thirdparty/patchwork.git/commitdiff
parser: Fix style issues
authorStephen Finucane <stephen@that.guru>
Sat, 30 Nov 2019 15:40:15 +0000 (15:40 +0000)
committerStephen Finucane <stephen@that.guru>
Sat, 30 Nov 2019 16:46:38 +0000 (16:46 +0000)
NOTE(stephenfin): Modified to fix another latent style issue that's
popping up here.

Signed-off-by: Stephen Finucane <stephen@that.guru>
Fixes: 8c229caa ("Improve pull request URL matching regex")
(cherry picked from commit 3ed6a1434dd90f073f5db5a6e85a80469aaaed40)

patchwork/parser.py

index e71d2de7cc369bc71ac2a96c116616528d5b4ed1..889a3721e0b0752e11ea58260ae6c993c94dadd9 100644 (file)
@@ -167,7 +167,7 @@ def clean_header(header):
     # on Py2, we want to do unicode(), on Py3, str().
     # That gets us the decoded, un-wrapped header.
     if six.PY2:
-        header_str = unicode(sane_header)
+        header_str = unicode(sane_header)  # noqa
     else:
         header_str = str(sane_header)
 
@@ -890,13 +890,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