From 3e3434ee1022158a397af870090151e9988a9e9b Mon Sep 17 00:00:00 2001 From: Alexander Kanavin Date: Tue, 19 Oct 2021 10:06:10 -1000 Subject: [PATCH] bitbake: bitbake: correct the collections vs collections.abc deprecation This becomes a hard error in python 3.10. (Bitbake rev: 4b66d498eab22eca29c9e3a7fdfa5c6e54055e78) Signed-off-by: Alexander Kanavin Signed-off-by: Richard Purdie (cherry picked from commit ae219e1f7460077f4492b31ac91cef4cf9b17277) Signed-off-by: Justin Bronder Signed-off-by: Steve Sakoman Signed-off-by: Richard Purdie --- bitbake/lib/bb/data_smart.py | 2 +- bitbake/lib/bb/persist_data.py | 5 +++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/bitbake/lib/bb/data_smart.py b/bitbake/lib/bb/data_smart.py index 68770832e0..c8d2a43724 100644 --- a/bitbake/lib/bb/data_smart.py +++ b/bitbake/lib/bb/data_smart.py @@ -17,7 +17,7 @@ BitBake build tools. # Based on functions from the base bb module, Copyright 2003 Holger Schurig import copy, re, sys, traceback -from collections import MutableMapping +from collections.abc import MutableMapping import logging import hashlib import bb, bb.codeparser diff --git a/bitbake/lib/bb/persist_data.py b/bitbake/lib/bb/persist_data.py index 5f4fbe3508..56c983f816 100644 --- a/bitbake/lib/bb/persist_data.py +++ b/bitbake/lib/bb/persist_data.py @@ -12,6 +12,7 @@ currently, providing a key/value store accessed by 'domain'. # import collections +import collections.abc import contextlib import functools import logging @@ -19,7 +20,7 @@ import os.path import sqlite3 import sys import warnings -from collections import Mapping +from collections.abc import Mapping sqlversion = sqlite3.sqlite_version_info if sqlversion[0] < 3 or (sqlversion[0] == 3 and sqlversion[1] < 3): @@ -29,7 +30,7 @@ if sqlversion[0] < 3 or (sqlversion[0] == 3 and sqlversion[1] < 3): logger = logging.getLogger("BitBake.PersistData") @functools.total_ordering -class SQLTable(collections.MutableMapping): +class SQLTable(collections.abc.MutableMapping): class _Decorators(object): @staticmethod def retry(*, reconnect=True):