Fix invalid escape sequence '\(' or '\)' (found by flake8)

flake8 found issues:
ubuntutools/sponsor_patch/bugtask.py:46:11: W605 invalid escape sequence '\('
ubuntutools/sponsor_patch/bugtask.py:62:50: W605 invalid escape sequence '\('
ubuntutools/sponsor_patch/bugtask.py:62:58: W605 invalid escape sequence '\)'
setup.py:14:8: W605 invalid escape sequence '\('
setup.py:14:14: W605 invalid escape sequence '\)'

Fix these issues by marking these strings as raw strings.
This commit is contained in:
Benjamin Drung 2018-10-06 18:04:25 +02:00
parent 74df5b3869
commit 190ad30a7b
2 changed files with 3 additions and 3 deletions

View File

@ -11,7 +11,7 @@ import codecs
changelog = "debian/changelog"
if os.path.exists(changelog):
head = codecs.open(changelog, 'r', 'utf-8', 'replace').readline()
match = re.compile(".*\((.*)\).*").match(head)
match = re.compile(r".*\((.*)\).*").match(head)
if match:
version = match.group(1)

View File

@ -43,7 +43,7 @@ class BugTask(object):
self.bug_task = bug_task
self.launchpad = launchpad
components = re.split(" \(| ", self.bug_task.bug_target_name.strip(")"))
components = re.split(r" \(| ", self.bug_task.bug_target_name.strip(")"))
assert len(components) >= 1 and len(components) <= 3
if len(components) == 1:
self.package = None
@ -59,7 +59,7 @@ class BugTask(object):
self.series = components[2].lower()
if self.package is None:
title_re = '^Sync ([a-z0-9+.-]+) [a-z0-9.+:~-]+ \([a-z]+\) from.*'
title_re = r'^Sync ([a-z0-9+.-]+) [a-z0-9.+:~-]+ \([a-z]+\) from.*'
match = re.match(title_re, self.get_bug_title(), re.U | re.I)
if match is not None:
self.package = match.group(1)