aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRichard Purdie <richard.purdie@linuxfoundation.org>2022-06-08 17:53:29 +0100
committerMartin Jansa <Martin.Jansa@gmail.com>2022-06-17 18:07:03 +0200
commit4d1abe0e553ae653f47451e579df150c3bb21870 (patch)
treea3e30271003d81e2bb8a0bf1484db5ceb164197b
parentbfbf7cec59efce9c442bf4ef937cb2db482650a4 (diff)
downloadbitbake-contrib-jansa/1.52.tar.gz
cooker: Drop sre_constants usagejansa/1.52
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. Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
-rw-r--r--lib/bb/cooker.py5
1 files changed, 2 insertions, 3 deletions
diff --git a/lib/bb/cooker.py b/lib/bb/cooker.py
index 288d73fd9..208e2fd4d 100644
--- a/lib/bb/cooker.py
+++ b/lib/bb/cooker.py
@@ -13,7 +13,6 @@ import sys, os, glob, os.path, re, time
import itertools
import logging
import multiprocessing
-import sre_constants
import threading
from io import StringIO, UnsupportedOperation
from contextlib import closing
@@ -1870,7 +1869,7 @@ class CookerCollectFiles(object):
try:
re.compile(mask)
bbmasks.append(mask)
- except sre_constants.error:
+ except re.error:
collectlog.critical("BBMASK contains an invalid regular expression, ignoring: %s" % mask)
# Then validate the combined regular expressions. This should never
@@ -1878,7 +1877,7 @@ class CookerCollectFiles(object):
bbmask = "|".join(bbmasks)
try:
bbmask_compiled = re.compile(bbmask)
- except sre_constants.error:
+ except re.error:
collectlog.critical("BBMASK is not a valid regular expression, ignoring: %s" % bbmask)
bbmask = None