diff options
| author | Adrian Freihofer <adrian.freihofer@gmail.com> | 2024-02-21 20:37:03 +0100 |
|---|---|---|
| committer | Steve Sakoman <steve@sakoman.com> | 2024-03-01 05:19:54 -1000 |
| commit | b8c9a27f06599b05b95720b1667f84e3c0c2836d (patch) | |
| tree | 1ca224acf1a43741387e609a24cb316e15f3d3c7 /meta/lib | |
| parent | 423bb12dcfb8dce3dc1ae345d34469d01809c750 (diff) | |
| download | poky-b8c9a27f06599b05b95720b1667f84e3c0c2836d.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: 939046c5e9ddd71b941c9e389fa4a4687bfcdec0)
Signed-off-by: Adrian Freihofer <adrian.freihofer@siemens.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Cherry-picked from master: 9002850f0c2e409d3bc629e36bb360b96326bb64
Signed-off-by: Adrian Freihofer <adrian.freihofer@siemens.com>
Signed-off-by: Steve Sakoman <steve@sakoman.com>
Diffstat (limited to 'meta/lib')
| -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 9c84466dd0..b53c611062 100644 --- a/meta/lib/oeqa/oetest.py +++ b/meta/lib/oeqa/oetest.py | |||
| @@ -256,7 +256,7 @@ class TestContext(object): | |||
| 256 | 256 | ||
| 257 | modules = [] | 257 | modules = [] |
| 258 | for test in self.testslist: | 258 | for test in self.testslist: |
| 259 | if re.search("\w+\.\w+\.test_\S+", test): | 259 | if re.search(r"\w+\.\w+\.test_\S+", test): |
| 260 | test = '.'.join(t.split('.')[:3]) | 260 | test = '.'.join(t.split('.')[:3]) |
| 261 | module = pkgutil.get_loader(test) | 261 | module = pkgutil.get_loader(test) |
| 262 | modules.append(module) | 262 | modules.append(module) |
diff --git a/meta/lib/oeqa/selftest/cases/bblayers.py b/meta/lib/oeqa/selftest/cases/bblayers.py index 7d74833f61..0b9f16eeae 100644 --- a/meta/lib/oeqa/selftest/cases/bblayers.py +++ b/meta/lib/oeqa/selftest/cases/bblayers.py | |||
| @@ -46,7 +46,7 @@ class BitbakeLayers(OESelftestTestCase): | |||
| 46 | bb_file = os.path.join(testoutdir, recipe_path, recipe_file) | 46 | bb_file = os.path.join(testoutdir, recipe_path, recipe_file) |
| 47 | self.assertTrue(os.path.isfile(bb_file), msg = "Cannot find xcursor-transparent-theme_0.1.1.bb in the test_bitbakelayers_flatten local dir.") | 47 | self.assertTrue(os.path.isfile(bb_file), msg = "Cannot find xcursor-transparent-theme_0.1.1.bb in the test_bitbakelayers_flatten local dir.") |
| 48 | contents = ftools.read_file(bb_file) | 48 | contents = ftools.read_file(bb_file) |
| 49 | find_in_contents = re.search("##### bbappended from meta-selftest #####\n(.*\n)*include test_recipe.inc", contents) | 49 | find_in_contents = re.search(r"##### bbappended from meta-selftest #####\n(.*\n)*include test_recipe.inc", contents) |
| 50 | self.assertTrue(find_in_contents, msg = "Flattening layers did not work. bitbake-layers flatten output: %s" % result.output) | 50 | self.assertTrue(find_in_contents, msg = "Flattening layers did not work. bitbake-layers flatten output: %s" % result.output) |
| 51 | 51 | ||
| 52 | def test_bitbakelayers_add_remove(self): | 52 | 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 d732a9020d..4d820faf92 100644 --- a/meta/lib/oeqa/selftest/cases/fitimage.py +++ b/meta/lib/oeqa/selftest/cases/fitimage.py | |||
| @@ -202,7 +202,7 @@ UBOOT_MKIMAGE_SIGN_ARGS = "-c 'a smart comment'" | |||
| 202 | signed_sections = {} | 202 | signed_sections = {} |
| 203 | for line in result.output.splitlines(): | 203 | for line in result.output.splitlines(): |
| 204 | if line.startswith((' Configuration', ' Image')): | 204 | if line.startswith((' Configuration', ' Image')): |
| 205 | in_signed = re.search('\((.*)\)', line).groups()[0] | 205 | in_signed = re.search(r'\((.*)\)', line).groups()[0] |
| 206 | elif re.match('^ *', line) in (' ', ''): | 206 | elif re.match('^ *', line) in (' ', ''): |
| 207 | in_signed = None | 207 | in_signed = None |
| 208 | elif in_signed: | 208 | elif in_signed: |
| @@ -521,7 +521,7 @@ UBOOT_FIT_HASH_ALG = "sha256" | |||
| 521 | signed_sections = {} | 521 | signed_sections = {} |
| 522 | for line in result.output.splitlines(): | 522 | for line in result.output.splitlines(): |
| 523 | if line.startswith((' Image')): | 523 | if line.startswith((' Image')): |
| 524 | in_signed = re.search('\((.*)\)', line).groups()[0] | 524 | in_signed = re.search(r'\((.*)\)', line).groups()[0] |
| 525 | elif re.match(' \w', line): | 525 | elif re.match(' \w', line): |
| 526 | in_signed = None | 526 | in_signed = None |
| 527 | elif in_signed: | 527 | elif in_signed: |
| @@ -675,7 +675,7 @@ FIT_SIGN_INDIVIDUAL = "1" | |||
| 675 | signed_sections = {} | 675 | signed_sections = {} |
| 676 | for line in result.output.splitlines(): | 676 | for line in result.output.splitlines(): |
| 677 | if line.startswith((' Image')): | 677 | if line.startswith((' Image')): |
| 678 | in_signed = re.search('\((.*)\)', line).groups()[0] | 678 | in_signed = re.search(r'\((.*)\)', line).groups()[0] |
| 679 | elif re.match(' \w', line): | 679 | elif re.match(' \w', line): |
| 680 | in_signed = None | 680 | in_signed = None |
| 681 | elif in_signed: | 681 | elif in_signed: |
