From 287c7228af7fe73c2356de5345c3884f49b51319 Mon Sep 17 00:00:00 2001 From: Sebastian Mohr Date: Tue, 15 Apr 2025 12:02:40 +0200 Subject: [PATCH] Fixed circular import issue introduced in last commit --- beets/plugins.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/beets/plugins.py b/beets/plugins.py index bf7b6db31..dbf3802e1 100644 --- a/beets/plugins.py +++ b/beets/plugins.py @@ -36,7 +36,6 @@ import mediafile import beets from beets import logging -from beets.library import Album, Item, Library if TYPE_CHECKING: from collections.abc import Iterable @@ -45,6 +44,7 @@ if TYPE_CHECKING: from beets.autotag import AlbumInfo, Distance, TrackInfo from beets.dbcore import Query + from beets.library import Album, Item, Library from beets.ui import Subcommand @@ -520,7 +520,11 @@ def import_stages(): # New-style (lazy) plugin-provided fields. -F = TypeVar("F", Callable[[Item], str], Callable[[Album], str]) + +if ( + TYPE_CHECKING +): # Needed because Item, Album circular introduce circular import + F = TypeVar("F", Callable[[Item], str], Callable[[Album], str]) def _check_conflicts_and_merge(