diff --git a/bandcamp_dl/__init__.py b/bandcamp_dl/__init__.py index 6ef440c..77585dd 100644 --- a/bandcamp_dl/__init__.py +++ b/bandcamp_dl/__init__.py @@ -1,6 +1,10 @@ import importlib.metadata import pathlib -import tomllib + +try: + import tomllib +except ModuleNotFoundError: + import toml try: __version__ = importlib.metadata.version("bandcamp-downloader") diff --git a/pyproject.toml b/pyproject.toml index 1e1b28f..1479636 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -25,7 +25,8 @@ dependencies = [ "mutagen >= 1.47.0", "requests >= 2.32.3", "unicode-slugify >= 0.1.5", - "urllib3 >= 2.2.2" + "urllib3 >= 2.2.2", + "toml ; python_version < '3.11'" ] [project.scripts]