Просмотр исходного кода

meta: correct collections vs collections.abc deprecation

collections.abc is available since 3.3 and doesn't need special handling.

(From OE-Core rev: 01152c9410ba00274c8415a5d914dc33dfd0cf46)

Signed-off-by: Alexander Kanavin <alex@linutronix.de>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Alexander Kanavin 3 лет назад
Родитель
Сommit
5128defbc3
2 измененных файлов с 3 добавлено и 7 удалено
  1. 1 6
      meta/lib/oe/maketype.py
  2. 2 1
      scripts/lib/build_perf/report.py

+ 1 - 6
meta/lib/oe/maketype.py

@@ -10,12 +10,7 @@ the arguments of the type's factory for details.
 
 
 import inspect
 import inspect
 import oe.types as types
 import oe.types as types
-try:
-    # Python 3.7+
-    from collections.abc import Callable
-except ImportError:
-    # Python < 3.7
-    from collections import Callable
+from collections.abc import Callable
 
 
 available_types = {}
 available_types = {}
 
 

+ 2 - 1
scripts/lib/build_perf/report.py

@@ -4,7 +4,8 @@
 # SPDX-License-Identifier: GPL-2.0-only
 # SPDX-License-Identifier: GPL-2.0-only
 #
 #
 """Handling of build perf test reports"""
 """Handling of build perf test reports"""
-from collections import OrderedDict, Mapping, namedtuple
+from collections import OrderedDict, namedtuple
+from collections.abc import Mapping
 from datetime import datetime, timezone
 from datetime import datetime, timezone
 from numbers import Number
 from numbers import Number
 from statistics import mean, stdev, variance
 from statistics import mean, stdev, variance