Compile URL matching regex before using it in the loop.
Signed-off-by: Mateusz Starzyk <mateusz.starzyk@mobica.com>
diff --git a/scripts/assemble_changelog.py b/scripts/assemble_changelog.py
index 147bae0..09d9dce 100755
--- a/scripts/assemble_changelog.py
+++ b/scripts/assemble_changelog.py
@@ -219,8 +219,9 @@
category.name.decode('utf8'))
body_split = category.body.splitlines()
+ re_has_url = re.compile('.*http[s]?://.*')
for line_number, line in enumerate(body_split, 1):
- if not re.match('.*http[s]?://.*', line.decode('utf-8')) and \
+ if not re_has_url.match(line.decode('utf-8')) and \
len(line) > MAX_LINE_LENGTH:
raise InputFormatError(filename,
category.body_line + line_number,