From bc8e326296bb948f828329a54319af9cf0613f09 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alberto=20Guti=C3=A9rrez=20Torre?= Date: Sun, 4 Feb 2024 10:26:10 +0100 Subject: [PATCH 1/2] fix: Fixed modern python Mapping import Closes #21 --- mopidy_cd/cdrom.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/mopidy_cd/cdrom.py b/mopidy_cd/cdrom.py index ed5cdf4..27318bf 100644 --- a/mopidy_cd/cdrom.py +++ b/mopidy_cd/cdrom.py @@ -5,7 +5,8 @@ import musicbrainzngs -from collections import Mapping, namedtuple +from collections.abc import Mapping +from collections import namedtuple from datetime import timedelta from mopidy.audio.scan import Scanner From 3908693acb1fdb4afeded36c18009b65ca8527f5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alberto=20Guti=C3=A9rrez=20Torre?= Date: Sun, 4 Feb 2024 10:34:26 +0100 Subject: [PATCH 2/2] feat: Make Mapping change backwards compatible --- mopidy_cd/cdrom.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/mopidy_cd/cdrom.py b/mopidy_cd/cdrom.py index 27318bf..2e041b9 100644 --- a/mopidy_cd/cdrom.py +++ b/mopidy_cd/cdrom.py @@ -5,7 +5,10 @@ import musicbrainzngs -from collections.abc import Mapping +try: + from collections.abc import Mapping +except ImportError: + from collections import Mapping # Backwards compatibility from collections import namedtuple from datetime import timedelta