Skip to content

Commit 89c2e10

Browse files
committed
Removed typealias, worked locally with mypy but does seem to cause
issues with the ci. Also python 3.9 requires unions here...
1 parent 837295e commit 89c2e10

File tree

2 files changed

+8
-9
lines changed

2 files changed

+8
-9
lines changed

beets/logging.py

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -37,9 +37,7 @@
3737
RootLogger,
3838
StreamHandler,
3939
)
40-
from typing import TYPE_CHECKING, Any, Mapping, TypeVar, overload
41-
42-
from typing_extensions import TypeAlias
40+
from typing import TYPE_CHECKING, Any, Mapping, TypeVar, Union, overload
4341

4442
__all__ = [
4543
"DEBUG",
@@ -60,12 +58,12 @@
6058
from types import TracebackType
6159

6260
# see https://github.com/python/typeshed/blob/main/stdlib/logging/__init__.pyi
63-
_SysExcInfoType: TypeAlias = (
64-
tuple[type[BaseException], BaseException, TracebackType | None]
65-
| tuple[None, None, None]
66-
)
67-
_ExcInfoType: TypeAlias = None | bool | _SysExcInfoType | BaseException
68-
_ArgsType: TypeAlias = tuple[object, ...] | Mapping[str, object]
61+
_SysExcInfoType = Union[
62+
tuple[type[BaseException], BaseException, Union[TracebackType, None]],
63+
tuple[None, None, None],
64+
]
65+
_ExcInfoType = Union[None, bool, _SysExcInfoType, BaseException]
66+
_ArgsType = Union[tuple[object, ...], Mapping[str, object]]
6967

7068

7169
def _logsafe(val: T) -> str | T:

test/test_logging.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
import sys
55
import threading
66
from types import ModuleType
7+
from unittest.mock import patch
78

89
import pytest
910

0 commit comments

Comments
 (0)