cooker: avoid DeprecationWarning with python-3.11
PATCH 1/1 cooker: avoid DeprecationWarning with python-3.11
* fixes:
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
--- lib/bb/cooker.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-)
lib/bb/cooker.py +4 -1
@@ -13,7 +13,10 @@ import sys, os, glob, os.path, re, time import itertools import logging import multiprocessing -import sre_constants +if sys.version_info >= (3, 11): + import re._constants as sre_constants +else: + import sre_constants import threading from io import StringIO, UnsupportedOperation from contextlib import closing
Signature · 1 line
2.35.1
Neither the old or the new is a documented item, so I believe it is better to eliminate the use entirely?
Alex
Quoted 41 lines · Martin Jansa
* fixes:
bitbake/lib/bb/cooker.py:16: DeprecationWarning: module 'sre_constants' is deprecated importsre_constantsit's deprecated since 3.11 with:
https://github.com/python/cpython/issues/91308Signed-off-by Martin Jansa <[email protected]>--- lib/bb/cooker.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-)lib/bb/cooker.py +4
-2@@ -13,7 +13,10 @@ import sys, os, glob, os.path, re, time import itertools import logging import multiprocessing -import sre_constants +if sys.version_info >= (3, 11): + import re._constants as sre_constants +else: + import sre_constants import threading from io import StringIO, UnsupportedOperation from contextlib import closing --2.35.1
-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#13739): https://lists.openembedded.org/g/bitbake-devel/message/13739
Mute This Topic: https://lists.openembedded.org/mt/91619426/1686489
Group Owner: [email protected]
Unsubscribe: https://lists.openembedded.org/g/bitbake-devel/unsub [[email protected]]
-=-=-=-=-=-=-=-=-=-=-=-
Quoted 18 lines · Martin Jansa
* fixes:
bitbake/lib/bb/cooker.py:16: DeprecationWarning: module 'sre_constants' is deprecated importsre_constantsit's deprecated since 3.11 with:
https://github.com/python/cpython/issues/91308Signed-off-by Martin Jansa <[email protected]>--- lib/bb/cooker.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-)lib/bb/cooker.py +0
-0@@ -13,7 +13,10 @@ import sys, os, glob, os.path, re, time import itertools
lib/bb/cooker.py import sys, os, glob, os.path, re, time · line 22
Quoted 10 lines
lib/bb/cooker.py +4
-1import logging import multiprocessing -import sre_constants +if sys.version_info >= (3, 11): + import re._constants as sre_constants +else: + import sre_constants import threading from io import StringIO, UnsupportedOperation from contextlib import closing
Looking at the code we only ever use sre_constants.error and this should really be re.error in modern python as far as I can tell so that change may be easier ?
Cheers,
Richard