debian/lib/python: Use raw strings for all regexes
Several regexes were written as normal strings. Thankfully it appears that none of the backslash-escaped sequences in them are parsed in normal strings, so this shouldn't make any practical difference.
This commit is contained in:
parent
0a74c462f0
commit
399eeb4b11
|
@ -8,6 +8,7 @@ linux (4.19~rc3-1~exp2) UNRELEASED; urgency=medium
|
||||||
* debian/control: Build-depend on libnuma-dev for linux-perf on all arches
|
* debian/control: Build-depend on libnuma-dev for linux-perf on all arches
|
||||||
* debian/control: Remove "cross" from profiles for build-dep on libssl-dev
|
* debian/control: Remove "cross" from profiles for build-dep on libssl-dev
|
||||||
* [mips64*] debian/control: Build-depend on gcc-multilib for linux-perf
|
* [mips64*] debian/control: Build-depend on gcc-multilib for linux-perf
|
||||||
|
* debian/lib/python: Use raw strings for all regexes
|
||||||
|
|
||||||
-- Ben Hutchings <ben@decadent.org.uk> Mon, 10 Sep 2018 22:25:53 +0100
|
-- Ben Hutchings <ben@decadent.org.uk> Mon, 10 Sep 2018 22:25:53 +0100
|
||||||
|
|
||||||
|
|
|
@ -34,7 +34,7 @@ class SchemaItemInteger(object):
|
||||||
|
|
||||||
|
|
||||||
class SchemaItemList(object):
|
class SchemaItemList(object):
|
||||||
def __init__(self, type="\s+"):
|
def __init__(self, type=r"\s+"):
|
||||||
self.type = type
|
self.type = type
|
||||||
|
|
||||||
def __call__(self, i):
|
def __call__(self, i):
|
||||||
|
|
|
@ -421,7 +421,7 @@ class PackageArchitecture(collections.MutableSet):
|
||||||
|
|
||||||
def extend(self, value):
|
def extend(self, value):
|
||||||
if isinstance(value, str):
|
if isinstance(value, str):
|
||||||
for i in re.split('\s', value.strip()):
|
for i in re.split(r'\s', value.strip()):
|
||||||
self.add(i)
|
self.add(i)
|
||||||
else:
|
else:
|
||||||
raise RuntimeError
|
raise RuntimeError
|
||||||
|
@ -493,7 +493,7 @@ class PackageRelation(list):
|
||||||
|
|
||||||
def extend(self, value, override_arches=None):
|
def extend(self, value, override_arches=None):
|
||||||
if isinstance(value, str):
|
if isinstance(value, str):
|
||||||
value = (j.strip() for j in re.split(',', value.strip()))
|
value = (j.strip() for j in re.split(r',', value.strip()))
|
||||||
for i in value:
|
for i in value:
|
||||||
self.append(i, override_arches)
|
self.append(i, override_arches)
|
||||||
|
|
||||||
|
@ -529,7 +529,7 @@ class PackageRelationGroup(list):
|
||||||
|
|
||||||
def extend(self, value, override_arches=None):
|
def extend(self, value, override_arches=None):
|
||||||
if isinstance(value, str):
|
if isinstance(value, str):
|
||||||
value = (j.strip() for j in re.split('\|', value.strip()))
|
value = (j.strip() for j in re.split(r'\|', value.strip()))
|
||||||
for i in value:
|
for i in value:
|
||||||
self.append(i, override_arches)
|
self.append(i, override_arches)
|
||||||
|
|
||||||
|
@ -612,11 +612,11 @@ class PackageRelationEntry(object):
|
||||||
self.operator = None
|
self.operator = None
|
||||||
self.version = match[2]
|
self.version = match[2]
|
||||||
if match[3] is not None:
|
if match[3] is not None:
|
||||||
self.arches = re.split('\s+', match[3])
|
self.arches = re.split(r'\s+', match[3])
|
||||||
else:
|
else:
|
||||||
self.arches = []
|
self.arches = []
|
||||||
if match[4] is not None:
|
if match[4] is not None:
|
||||||
self.restrictions = re.split('\s+', match[4])
|
self.restrictions = re.split(r'\s+', match[4])
|
||||||
else:
|
else:
|
||||||
self.restrictions = []
|
self.restrictions = []
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue