diff --git a/tom/dependencies.py b/tom/dependencies.py index 370b74a..08976f0 100644 --- a/tom/dependencies.py +++ b/tom/dependencies.py @@ -63,7 +63,7 @@ def get_deps_list(self, branch="master"): options_lines = options_file.splitlines() if branch == "3.7.x": filtered_lines = ( - x for x in options_lines if re.match('\s*DEPS=".*\\$DEPS', x) + x for x in options_lines if re.match(r'\s*DEPS=".*\$DEPS', x) ) only_deps = (re.sub("\\$?DEPS", "", x) for x in filtered_lines) only_deps = (re.sub('[=";]', "", x) for x in only_deps) @@ -183,7 +183,7 @@ def extract_version_from_filename(self, dep, filename): version = re.search("w32-([0-9-]*)-rel", filename).group(1) separator = "-" else: - version = re.search("[-_]([0-9.]*)[\.-]", filename).group(1) + version = re.search(r"[-_]([0-9.]*)[\.-]", filename).group(1) separator = "." return (version, separator) @@ -437,7 +437,7 @@ def update_deps_version(self, branches): # \[([a-z0-9-]*)\] will match [PHP] # \((.*?)\) will match (http://php.net/) match = re.match( - "\| \[([a-z0-9-]*)\]\((.*?)\) ", line, flags=re.IGNORECASE + r"\| \[([a-z0-9-]*)\]\((.*?)\) ", line, flags=re.IGNORECASE ) if match: dep_title = match.group(1) @@ -454,7 +454,7 @@ def update_deps_version(self, branches): ) deps_table[dep] = collections.defaultdict(lambda: "-") if has_notes: - note = re.search("\| ([^|]*) \|$", line) + note = re.search(r"\| ([^|]*) \|$", line) if not note: log.warn("didn't find note in line [%s]", line) note = "" diff --git a/tom/packages.py b/tom/packages.py index 52d8b06..e431109 100644 --- a/tom/packages.py +++ b/tom/packages.py @@ -44,9 +44,9 @@ def is_branch_or_version(string): optionally followed by letter (3.12.5b) for aplha/beta/gamma...zeta, optionally followed by release (3.12.5-2). """ - if string == "master" or re.match("3\.\\d+\.x$", string): + if string == "master" or re.match(r"3\.\d+\.x$", string): return "branch" - if re.match("3\\.\\d+\\.\\d+[a-z]?(-\\d+)?$", string): + if re.match(r"3\.\d+\.\d+[a-z]?(-\d+)?$", string): return "version" return None