From c13d8c5fa1f00c663baa84d486156f97f1232739 Mon Sep 17 00:00:00 2001 From: "Arav K." Date: Sat, 8 Jun 2024 00:06:41 +0200 Subject: [PATCH] Ensure support for Python 3.8 'typing.Never' was introduced later, and 'typing.Type' was used instead of just 'type' until 3.9. This commit will likely be reverted over time as these 3.8 etc. get dropped. --- beets/dbcore/types.py | 2 +- beets/library.py | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/beets/dbcore/types.py b/beets/dbcore/types.py index 469991c84..432db2b72 100644 --- a/beets/dbcore/types.py +++ b/beets/dbcore/types.py @@ -232,7 +232,7 @@ class BaseFloat(Type[float, N]): """ sql = "REAL" - query: type[FieldQuery[Any]] = NumericQuery + query: typing.Type[FieldQuery[Any]] = NumericQuery model_type = float def __init__(self, digits: int = 1): diff --git a/beets/library.py b/beets/library.py index d44ccdd25..7fead8ca1 100644 --- a/beets/library.py +++ b/beets/library.py @@ -22,8 +22,8 @@ import string import sys import time import unicodedata -from typing import Never from functools import cached_property +from typing import NoReturn from mediafile import MediaFile, UnreadableFileError @@ -50,7 +50,7 @@ log = logging.getLogger("beets") # Library-specific query types. -class SingletonQuery(dbcore.FieldQuery[Never]): +class SingletonQuery(dbcore.FieldQuery[NoReturn]): """This query is responsible for the 'singleton' lookup. It is based on the FieldQuery and constructs a SQL clause