diff options
author | Adrian Freihofer <adrian.freihofer@gmail.com> | 2024-02-10 14:15:57 +0100 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2024-02-13 13:51:41 +0000 |
commit | 7f2755daca55c0abdca9a9a2c01ddc21292a99d6 (patch) | |
tree | 58c619d8282af4bae6c0ef0b01285672c4b365ac | |
parent | 66850944957c312d3acc361267536b1f4aa8474e (diff) | |
download | poky-7f2755daca55c0abdca9a9a2c01ddc21292a99d6.tar.gz |
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>
-rw-r--r-- | meta/lib/oeqa/oetest.py | 2 | ||||
-rw-r--r-- | meta/lib/oeqa/selftest/cases/bblayers.py | 2 | ||||
-rw-r--r-- | meta/lib/oeqa/selftest/cases/fitimage.py | 6 |
3 files changed, 5 insertions, 5 deletions
diff --git a/meta/lib/oeqa/oetest.py b/meta/lib/oeqa/oetest.py index cf417db0d4..bcb6a878c7 100644 --- a/meta/lib/oeqa/oetest.py +++ b/meta/lib/oeqa/oetest.py | |||
@@ -241,7 +241,7 @@ class TestContext(object): | |||
241 | 241 | ||
242 | modules = [] | 242 | modules = [] |
243 | for test in self.testslist: | 243 | for test in self.testslist: |
244 | if re.search("\w+\.\w+\.test_\S+", test): | 244 | if re.search(r"\w+\.\w+\.test_\S+", test): |
245 | test = '.'.join(t.split('.')[:3]) | 245 | test = '.'.join(t.split('.')[:3]) |
246 | module = pkgutil.get_loader(test) | 246 | module = pkgutil.get_loader(test) |
247 | modules.append(module) | 247 | modules.append(module) |
diff --git a/meta/lib/oeqa/selftest/cases/bblayers.py b/meta/lib/oeqa/selftest/cases/bblayers.py index 8faa060234..2475a79468 100644 --- a/meta/lib/oeqa/selftest/cases/bblayers.py +++ b/meta/lib/oeqa/selftest/cases/bblayers.py | |||
@@ -54,7 +54,7 @@ class BitbakeLayers(OESelftestTestCase): | |||
54 | bb_file = os.path.join(testoutdir, recipe_path, recipe_file) | 54 | bb_file = os.path.join(testoutdir, recipe_path, recipe_file) |
55 | self.assertTrue(os.path.isfile(bb_file), msg = "Cannot find xcursor-transparent-theme_0.1.1.bb in the test_bitbakelayers_flatten local dir.") | 55 | self.assertTrue(os.path.isfile(bb_file), msg = "Cannot find xcursor-transparent-theme_0.1.1.bb in the test_bitbakelayers_flatten local dir.") |
56 | contents = ftools.read_file(bb_file) | 56 | contents = ftools.read_file(bb_file) |
57 | find_in_contents = re.search("##### bbappended from meta-selftest #####\n(.*\n)*include test_recipe.inc", contents) | 57 | find_in_contents = re.search(r"##### bbappended from meta-selftest #####\n(.*\n)*include test_recipe.inc", contents) |
58 | self.assertTrue(find_in_contents, msg = "Flattening layers did not work. bitbake-layers flatten output: %s" % result.output) | 58 | self.assertTrue(find_in_contents, msg = "Flattening layers did not work. bitbake-layers flatten output: %s" % result.output) |
59 | 59 | ||
60 | def test_bitbakelayers_add_remove(self): | 60 | def test_bitbakelayers_add_remove(self): |
diff --git a/meta/lib/oeqa/selftest/cases/fitimage.py b/meta/lib/oeqa/selftest/cases/fitimage.py index 9383d0c4db..347c065377 100644 --- a/meta/lib/oeqa/selftest/cases/fitimage.py +++ b/meta/lib/oeqa/selftest/cases/fitimage.py | |||
@@ -204,7 +204,7 @@ UBOOT_MKIMAGE_SIGN_ARGS = "-c 'a smart comment'" | |||
204 | signed_sections = {} | 204 | signed_sections = {} |
205 | for line in result.output.splitlines(): | 205 | for line in result.output.splitlines(): |
206 | if line.startswith((' Configuration', ' Image')): | 206 | if line.startswith((' Configuration', ' Image')): |
207 | in_signed = re.search('\((.*)\)', line).groups()[0] | 207 | in_signed = re.search(r'\((.*)\)', line).groups()[0] |
208 | elif re.match('^ *', line) in (' ', ''): | 208 | elif re.match('^ *', line) in (' ', ''): |
209 | in_signed = None | 209 | in_signed = None |
210 | elif in_signed: | 210 | elif in_signed: |
@@ -525,7 +525,7 @@ UBOOT_FIT_HASH_ALG = "sha256" | |||
525 | signed_sections = {} | 525 | signed_sections = {} |
526 | for line in result.output.splitlines(): | 526 | for line in result.output.splitlines(): |
527 | if line.startswith((' Image')): | 527 | if line.startswith((' Image')): |
528 | in_signed = re.search('\((.*)\)', line).groups()[0] | 528 | in_signed = re.search(r'\((.*)\)', line).groups()[0] |
529 | elif re.match(' \w', line): | 529 | elif re.match(' \w', line): |
530 | in_signed = None | 530 | in_signed = None |
531 | elif in_signed: | 531 | elif in_signed: |
@@ -680,7 +680,7 @@ FIT_SIGN_INDIVIDUAL = "1" | |||
680 | signed_sections = {} | 680 | signed_sections = {} |
681 | for line in result.output.splitlines(): | 681 | for line in result.output.splitlines(): |
682 | if line.startswith((' Image')): | 682 | if line.startswith((' Image')): |
683 | in_signed = re.search('\((.*)\)', line).groups()[0] | 683 | in_signed = re.search(r'\((.*)\)', line).groups()[0] |
684 | elif re.match(' \w', line): | 684 | elif re.match(' \w', line): |
685 | in_signed = None | 685 | in_signed = None |
686 | elif in_signed: | 686 | elif in_signed: |