diff options
author | Richard Purdie <richard.purdie@linuxfoundation.org> | 2022-09-13 04:26:32 -1000 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2022-09-16 17:53:22 +0100 |
commit | a18a0145111e557fc4aae9234fbe82aea4720ec5 (patch) | |
tree | 60aec61dfa09d5bf803e9730467b5c3367cda58a /bitbake | |
parent | 74883eca07dbb4d2e6a3dd8bd40027025a457ba2 (diff) | |
download | poky-a18a0145111e557fc4aae9234fbe82aea4720ec5.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: c98007217b8e40f1abfdcba709185dc5ddbcd0c2)
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
(cherry picked from commit 3c0cd401472ffee06d5a93bdba566cb033851fcf)
Signed-off-by: Steve Sakoman <steve@sakoman.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'bitbake')
-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 6da9291f9c..2adf4d297d 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 |
@@ -1907,7 +1906,7 @@ class CookerCollectFiles(object): | |||
1907 | try: | 1906 | try: |
1908 | re.compile(mask) | 1907 | re.compile(mask) |
1909 | bbmasks.append(mask) | 1908 | bbmasks.append(mask) |
1910 | except sre_constants.error: | 1909 | except re.error: |
1911 | collectlog.critical("BBMASK contains an invalid regular expression, ignoring: %s" % mask) | 1910 | collectlog.critical("BBMASK contains an invalid regular expression, ignoring: %s" % mask) |
1912 | 1911 | ||
1913 | # Then validate the combined regular expressions. This should never | 1912 | # Then validate the combined regular expressions. This should never |
@@ -1915,7 +1914,7 @@ class CookerCollectFiles(object): | |||
1915 | bbmask = "|".join(bbmasks) | 1914 | bbmask = "|".join(bbmasks) |
1916 | try: | 1915 | try: |
1917 | bbmask_compiled = re.compile(bbmask) | 1916 | bbmask_compiled = re.compile(bbmask) |
1918 | except sre_constants.error: | 1917 | except re.error: |
1919 | collectlog.critical("BBMASK is not a valid regular expression, ignoring: %s" % bbmask) | 1918 | collectlog.critical("BBMASK is not a valid regular expression, ignoring: %s" % bbmask) |
1920 | bbmask = None | 1919 | bbmask = None |
1921 | 1920 | ||