mirror of
https://git.yoctoproject.org/poky
synced 2026-09-14 12:49:34 +02:00
meta/lib/oeqa: python 3.12 regex
Python 3 interprets string literals as Unicode strings, and therefore \s is treated as an escaped Unicode character which is not correct. Declaring the RegEx pattern as a raw string instead of unicode is required for Python 3. (From OE-Core rev: 9002850f0c2e409d3bc629e36bb360b96326bb64) Signed-off-by: Adrian Freihofer <adrian.freihofer@siemens.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
This commit is contained in:
committed by
Richard Purdie
parent
6685094495
commit
7f2755daca
@@ -241,7 +241,7 @@ class TestContext(object):
|
|||||||
|
|
||||||
modules = []
|
modules = []
|
||||||
for test in self.testslist:
|
for test in self.testslist:
|
||||||
if re.search("\w+\.\w+\.test_\S+", test):
|
if re.search(r"\w+\.\w+\.test_\S+", test):
|
||||||
test = '.'.join(t.split('.')[:3])
|
test = '.'.join(t.split('.')[:3])
|
||||||
module = pkgutil.get_loader(test)
|
module = pkgutil.get_loader(test)
|
||||||
modules.append(module)
|
modules.append(module)
|
||||||
|
|||||||
@@ -54,7 +54,7 @@ class BitbakeLayers(OESelftestTestCase):
|
|||||||
bb_file = os.path.join(testoutdir, recipe_path, recipe_file)
|
bb_file = os.path.join(testoutdir, recipe_path, recipe_file)
|
||||||
self.assertTrue(os.path.isfile(bb_file), msg = "Cannot find xcursor-transparent-theme_0.1.1.bb in the test_bitbakelayers_flatten local dir.")
|
self.assertTrue(os.path.isfile(bb_file), msg = "Cannot find xcursor-transparent-theme_0.1.1.bb in the test_bitbakelayers_flatten local dir.")
|
||||||
contents = ftools.read_file(bb_file)
|
contents = ftools.read_file(bb_file)
|
||||||
find_in_contents = re.search("##### bbappended from meta-selftest #####\n(.*\n)*include test_recipe.inc", contents)
|
find_in_contents = re.search(r"##### bbappended from meta-selftest #####\n(.*\n)*include test_recipe.inc", contents)
|
||||||
self.assertTrue(find_in_contents, msg = "Flattening layers did not work. bitbake-layers flatten output: %s" % result.output)
|
self.assertTrue(find_in_contents, msg = "Flattening layers did not work. bitbake-layers flatten output: %s" % result.output)
|
||||||
|
|
||||||
def test_bitbakelayers_add_remove(self):
|
def test_bitbakelayers_add_remove(self):
|
||||||
|
|||||||
@@ -204,7 +204,7 @@ UBOOT_MKIMAGE_SIGN_ARGS = "-c 'a smart comment'"
|
|||||||
signed_sections = {}
|
signed_sections = {}
|
||||||
for line in result.output.splitlines():
|
for line in result.output.splitlines():
|
||||||
if line.startswith((' Configuration', ' Image')):
|
if line.startswith((' Configuration', ' Image')):
|
||||||
in_signed = re.search('\((.*)\)', line).groups()[0]
|
in_signed = re.search(r'\((.*)\)', line).groups()[0]
|
||||||
elif re.match('^ *', line) in (' ', ''):
|
elif re.match('^ *', line) in (' ', ''):
|
||||||
in_signed = None
|
in_signed = None
|
||||||
elif in_signed:
|
elif in_signed:
|
||||||
@@ -525,7 +525,7 @@ UBOOT_FIT_HASH_ALG = "sha256"
|
|||||||
signed_sections = {}
|
signed_sections = {}
|
||||||
for line in result.output.splitlines():
|
for line in result.output.splitlines():
|
||||||
if line.startswith((' Image')):
|
if line.startswith((' Image')):
|
||||||
in_signed = re.search('\((.*)\)', line).groups()[0]
|
in_signed = re.search(r'\((.*)\)', line).groups()[0]
|
||||||
elif re.match(' \w', line):
|
elif re.match(' \w', line):
|
||||||
in_signed = None
|
in_signed = None
|
||||||
elif in_signed:
|
elif in_signed:
|
||||||
@@ -680,7 +680,7 @@ FIT_SIGN_INDIVIDUAL = "1"
|
|||||||
signed_sections = {}
|
signed_sections = {}
|
||||||
for line in result.output.splitlines():
|
for line in result.output.splitlines():
|
||||||
if line.startswith((' Image')):
|
if line.startswith((' Image')):
|
||||||
in_signed = re.search('\((.*)\)', line).groups()[0]
|
in_signed = re.search(r'\((.*)\)', line).groups()[0]
|
||||||
elif re.match(' \w', line):
|
elif re.match(' \w', line):
|
||||||
in_signed = None
|
in_signed = None
|
||||||
elif in_signed:
|
elif in_signed:
|
||||||
|
|||||||
Reference in New Issue
Block a user