summaryrefslogtreecommitdiffstats
path: root/bitbake/lib/bb/cooker.py
diff options
context:
space:
mode:
authorRichard Purdie <richard.purdie@linuxfoundation.org>2022-06-08 17:53:29 +0100
committerRichard Purdie <richard.purdie@linuxfoundation.org>2022-06-11 10:30:56 +0100
commit27915d3d8a851253c0f019909b7203186a681b55 (patch)
tree58c9339719b058ad86be7d20ff68e228221ffdcb /bitbake/lib/bb/cooker.py
parent614aed1c1dc870cdb507e101b48805ef493bbd16 (diff)
downloadpoky-27915d3d8a851253c0f019909b7203186a681b55.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: 3c0cd401472ffee06d5a93bdba566cb033851fcf) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'bitbake/lib/bb/cooker.py')
-rw-r--r--bitbake/lib/bb/cooker.py5
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
13import itertools 13import itertools
14import logging 14import logging
15import multiprocessing 15import multiprocessing
16import sre_constants
17import threading 16import threading
18from io import StringIO, UnsupportedOperation 17from io import StringIO, UnsupportedOperation
19from contextlib import closing 18from 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