mirror of
https://github.com/beetbox/beets.git
synced 2025-12-06 08:39:17 +01:00
Check Python version instead of catching ImportError
This commit is contained in:
parent
89f1bda4e0
commit
1c020b8264
2 changed files with 6 additions and 6 deletions
|
|
@ -45,11 +45,11 @@ from typing import (
|
|||
Union,
|
||||
)
|
||||
|
||||
try:
|
||||
# Python 3.10+
|
||||
if sys.version_info >= (3, 10):
|
||||
from typing import TypeAlias
|
||||
except ImportError:
|
||||
else:
|
||||
from typing_extensions import TypeAlias
|
||||
|
||||
from unidecode import unidecode
|
||||
|
||||
from beets.util import hidden
|
||||
|
|
|
|||
|
|
@ -17,6 +17,7 @@
|
|||
|
||||
import os
|
||||
import re
|
||||
import sys
|
||||
from dataclasses import dataclass
|
||||
from mimetypes import guess_type
|
||||
from typing import ClassVar, Mapping, Type
|
||||
|
|
@ -30,10 +31,9 @@ from flask import (
|
|||
send_file,
|
||||
)
|
||||
|
||||
try:
|
||||
# Python 3.11+
|
||||
if sys.version_info >= (3, 11):
|
||||
from typing import Self
|
||||
except ImportError:
|
||||
else:
|
||||
from typing_extensions import Self
|
||||
|
||||
from beets import config
|
||||
|
|
|
|||
Loading…
Reference in a new issue