[1.50,1/8] bitbake: correct the collections vs collections.abc deprecation

Message ID 8e76cfcd9a88329fcbf80cfe4bbd839c32c9187f.1637547674.git.anuj.mittal@intel.com
State Accepted, archived
Commit 2805102e2a142c8e821519b651e4035353bbb717
Headers show
Series [1.50,1/8] bitbake: correct the collections vs collections.abc deprecation | expand

Commit Message

Mittal, Anuj Nov. 22, 2021, 2:24 a.m. UTC
From: Alexander Kanavin <alex.kanavin@gmail.com>

This becomes a hard error in python 3.10.

Signed-off-by: Alexander Kanavin <alex@linutronix.de>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
(cherry picked from commit ae219e1f7460077f4492b31ac91cef4cf9b17277)
Signed-off-by: Anuj Mittal <anuj.mittal@intel.com>
---
 lib/bb/cache.py        | 3 ++-
 lib/bb/data_smart.py   | 2 +-
 lib/bb/persist_data.py | 5 +++--
 3 files changed, 6 insertions(+), 4 deletions(-)

Patch

diff --git a/lib/bb/cache.py b/lib/bb/cache.py
index 27eb2717..5f9c0a77 100644
--- a/lib/bb/cache.py
+++ b/lib/bb/cache.py
@@ -19,7 +19,8 @@ 
 import os
 import logging
 import pickle
-from collections import defaultdict, Mapping
+from collections import defaultdict
+from collections.abc import Mapping
 import bb.utils
 from bb import PrefixLoggerAdapter
 import re
diff --git a/lib/bb/data_smart.py b/lib/bb/data_smart.py
index 8291ca65..aa9ac2c8 100644
--- a/lib/bb/data_smart.py
+++ b/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/lib/bb/persist_data.py b/lib/bb/persist_data.py
index c6a209fb..6f32d81a 100644
--- a/lib/bb/persist_data.py
+++ b/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):