Use inspect instead of isclass in load_plugin function to fix import

issues.
This commit is contained in:
Sebastian Mohr 2025-07-07 13:34:06 +02:00
parent 24295d6844
commit 5fe8431a65

View file

@ -44,8 +44,6 @@ if TYPE_CHECKING:
from confuse import ConfigView
from beets.autotag import AlbumInfo, TrackInfo
from beets.autotag.distance import Distance
from beets.dbcore import Query
from beets.dbcore.db import FieldQueryType
from beets.dbcore.types import Type
@ -299,7 +297,7 @@ def load_plugins(names: Sequence[str] = ()) -> None:
else:
for obj in getattr(namespace, name).__dict__.values():
if (
isinstance(obj, type)
inspect.isclass(obj)
and issubclass(obj, BeetsPlugin)
and obj != BeetsPlugin
and not inspect.isabstract(obj)
@ -520,8 +518,6 @@ def feat_tokens(for_artist: bool = True) -> str:
)
def apply_item_changes(
lib: Library, item: Item, move: bool, pretend: bool, write: bool
) -> None: