diff options
author | Richard Purdie <richard.purdie@linuxfoundation.org> | 2023-02-17 13:27:58 +0100 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2023-02-22 10:12:33 +0000 |
commit | 86e2430d3f40433f978667f15ab6d20d0663e56d (patch) | |
tree | e7982ee4711fd6743afbcdbb387094d24ca235ab /bitbake/lib/bb | |
parent | bf604a8fa80f0610a9d240878994cb45cc58dd3a (diff) | |
download | poky-86e2430d3f40433f978667f15ab6d20d0663e56d.tar.gz |
bitbake: cooker: Drop sre_constants usage
As reported by Martin Jansa <Martin.Jansa@gmail.com>:
bitbake/lib/bb/cooker.py:16: DeprecationWarning: module 'sre_constants' is deprecated
import sre_constants
it's deprecated since 3.11 with:
https://github.com/python/cpython/issues/91308
The correct replacement for our usage is re.error so use that instead.
(Bitbake rev: a4cd5b0b4b355b7b75fb48c61289700e3e908b2a)
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Signed-off-by: Steve Sakoman <steve@sakoman.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'bitbake/lib/bb')
-rw-r--r-- | bitbake/lib/bb/cooker.py | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/bitbake/lib/bb/cooker.py b/bitbake/lib/bb/cooker.py index ac54d4378d..6743bce585 100644 --- a/bitbake/lib/bb/cooker.py +++ b/bitbake/lib/bb/cooker.py | |||
@@ -13,7 +13,6 @@ import sys, os, glob, os.path, re, time | |||
13 | import itertools | 13 | import itertools |
14 | import logging | 14 | import logging |
15 | import multiprocessing | 15 | import multiprocessing |
16 | import sre_constants | ||
17 | import threading | 16 | import threading |
18 | from io import StringIO, UnsupportedOperation | 17 | from io import StringIO, UnsupportedOperation |
19 | from contextlib import closing | 18 | from contextlib import closing |
@@ -1795,7 +1794,7 @@ class CookerCollectFiles(object): | |||
1795 | try: | 1794 | try: |
1796 | re.compile(mask) | 1795 | re.compile(mask) |
1797 | bbmasks.append(mask) | 1796 | bbmasks.append(mask) |
1798 | except sre_constants.error: | 1797 | except re.error: |
1799 | collectlog.critical("BBMASK contains an invalid regular expression, ignoring: %s" % mask) | 1798 | collectlog.critical("BBMASK contains an invalid regular expression, ignoring: %s" % mask) |
1800 | 1799 | ||
1801 | # Then validate the combined regular expressions. This should never | 1800 | # Then validate the combined regular expressions. This should never |
@@ -1803,7 +1802,7 @@ class CookerCollectFiles(object): | |||
1803 | bbmask = "|".join(bbmasks) | 1802 | bbmask = "|".join(bbmasks) |
1804 | try: | 1803 | try: |
1805 | bbmask_compiled = re.compile(bbmask) | 1804 | bbmask_compiled = re.compile(bbmask) |
1806 | except sre_constants.error: | 1805 | except re.error: |
1807 | collectlog.critical("BBMASK is not a valid regular expression, ignoring: %s" % bbmask) | 1806 | collectlog.critical("BBMASK is not a valid regular expression, ignoring: %s" % bbmask) |
1808 | bbmask = None | 1807 | bbmask = None |
1809 | 1808 | ||