From 07a798049389b2712437ec603a2832a5fa36083f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?F=C3=A9lix=20Voituret?= Date: Fri, 8 Jan 2021 19:10:01 +0100 Subject: [PATCH] =?UTF-8?q?=F0=9F=90=9B=20=20restore=20alternative=20impor?= =?UTF-8?q?t?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- spleeter/utils/configuration.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/spleeter/utils/configuration.py b/spleeter/utils/configuration.py index ba6318b..6a026b1 100644 --- a/spleeter/utils/configuration.py +++ b/spleeter/utils/configuration.py @@ -3,11 +3,17 @@ """ Module that provides configuration loading function. """ -import importlib.resources as loader import json from os.path import exists from typing import Dict +try: + import importlib.resources as loader +except ImportError: + # Try backported to PY<37 `importlib_resources`. + # pyright: reportMissingImports=false + import importlib_resources as loader + from .. import SpleeterError, resources __email__ = "spleeter@deezer.com"