From c077638b724d2014eb45de3f90148e9046985066 Mon Sep 17 00:00:00 2001 From: J0J0 Todos Date: Sun, 8 Feb 2026 09:12:27 +0100 Subject: [PATCH] lastgenre: Fix type hints after refactor --- beetsplug/lastgenre/loaders.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/beetsplug/lastgenre/loaders.py b/beetsplug/lastgenre/loaders.py index c0132315e..0992ca14e 100644 --- a/beetsplug/lastgenre/loaders.py +++ b/beetsplug/lastgenre/loaders.py @@ -19,7 +19,7 @@ from __future__ import annotations from pathlib import Path -from typing import TYPE_CHECKING +from typing import TYPE_CHECKING, Any import yaml @@ -92,7 +92,7 @@ class DataFileLoader: wl_filename = config_value if wl_filename in (True, "", None): # Indicates the default whitelist. wl_filename = default_path - if wl_filename: + if wl_filename and isinstance(wl_filename, str): log.debug("Loading whitelist {}", wl_filename) text = Path(wl_filename).expanduser().read_text(encoding="utf-8") for line in text.splitlines(): @@ -122,7 +122,7 @@ class DataFileLoader: ): c14n_filename = default_path # Read the tree - if c14n_filename: + if c14n_filename and isinstance(c14n_filename, str): log.debug("Loading canonicalization tree {}", c14n_filename) with Path(c14n_filename).expanduser().open(encoding="utf-8") as f: genres_tree = yaml.safe_load(f) @@ -131,7 +131,7 @@ class DataFileLoader: @staticmethod def flatten_tree( - elem: dict | list | str, + elem: dict[str, Any] | list[Any] | str, path: list[str], branches: list[list[str]], ) -> None: