From e31044fae4b609b36ee4a6a0678edb03023af816 Mon Sep 17 00:00:00 2001 From: Til Boerner Date: Fri, 28 Jan 2022 12:48:37 +0100 Subject: [PATCH] Fix import error from ABC classes in Python >= 3.10 --- cherrymusicserver/configuration.py | 6 +++++- tinytag/tinytag.py | 5 ++++- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/cherrymusicserver/configuration.py b/cherrymusicserver/configuration.py index 4e3f70f7..8c4140e4 100644 --- a/cherrymusicserver/configuration.py +++ b/cherrymusicserver/configuration.py @@ -38,7 +38,11 @@ import re import weakref -from collections import Mapping, namedtuple +try: + from collections.abc import Mapping +except ImportError: + from collections import Mapping +from collections import namedtuple from backport.collections import OrderedDict from backport import callable diff --git a/tinytag/tinytag.py b/tinytag/tinytag.py index 82835800..e60b973e 100644 --- a/tinytag/tinytag.py +++ b/tinytag/tinytag.py @@ -23,7 +23,10 @@ # along with this program. If not, see # -from collections import MutableMapping +try: + from collections.abc import MutableMapping +except ImportError: + from collections import MutableMapping import codecs from functools import reduce import struct