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.
This commit is contained in:
Arav K. 2024-06-08 00:06:41 +02:00
parent d3bdf137ea
commit c13d8c5fa1
2 changed files with 3 additions and 3 deletions

View file

@ -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):

View file

@ -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