Don't use typing.Self (yet).

typing.Self has only been introduced in Python 3.10.
This commit is contained in:
Fabio Manganiello 2023-06-27 14:15:55 +02:00
parent b01bf43552
commit 77f7cd8b90
Signed by untrusted user: blacklight
GPG key ID: D90FBA7F76362774
2 changed files with 4 additions and 4 deletions

View file

@ -4,7 +4,7 @@ from asyncio.subprocess import PIPE
from logging import getLogger
from queue import Empty, Queue
from threading import Event, RLock, Thread
from typing import Any, Callable, Coroutine, Iterable, Optional, Self
from typing import Any, Callable, Coroutine, Iterable, Optional
from platypush.context import get_or_create_event_loop
@ -87,7 +87,7 @@ class AudioConverter(Thread, ABC):
self._on_exit = on_exit
self._ffmpeg_terminated = Event()
def __enter__(self) -> Self:
def __enter__(self) -> "AudioConverter":
"""
Audio converter context manager.

View file

@ -1,5 +1,5 @@
from abc import ABC
from typing import IO, Iterable, List, Optional, Self, Type, Union
from typing import IO, Iterable, List, Optional, Type, Union
from typing_extensions import override
import numpy as np
@ -39,7 +39,7 @@ class AudioPlayer(AudioThread, ABC):
infile: Optional[str] = None,
sound: Optional[Union[dict, Iterable[dict]]] = None,
**kwargs,
) -> Self:
) -> "AudioPlayer":
from ._resource import AudioResourcePlayer
from ._synth import AudioSynthPlayer, Sound