Skip to content

Commit

Permalink
Tentative TOML fix
Browse files Browse the repository at this point in the history
Added Python version dependent inclusion for toml and a try/except to get the right import
  • Loading branch information
Evolution0 committed Oct 11, 2024
1 parent f1c947c commit 7154b52
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
6 changes: 5 additions & 1 deletion bandcamp_dl/__init__.py
Original file line number Diff line number Diff line change
@@ -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")
Expand Down
3 changes: 2 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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]
Expand Down

0 comments on commit 7154b52

Please sign in to comment.