mirror of
https://git.launchpad.net/ubuntu-dev-tools
synced 2025-03-12 23:51:08 +00:00
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:
parent
74df5b3869
commit
190ad30a7b
2
setup.py
2
setup.py
@ -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)
|
||||
|
||||
|
@ -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)
|
||||
|
Loading…
x
Reference in New Issue
Block a user