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: 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 logging import getLogger
from queue import Empty, Queue from queue import Empty, Queue
from threading import Event, RLock, Thread 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 from platypush.context import get_or_create_event_loop
@ -87,7 +87,7 @@ class AudioConverter(Thread, ABC):
self._on_exit = on_exit self._on_exit = on_exit
self._ffmpeg_terminated = Event() self._ffmpeg_terminated = Event()
def __enter__(self) -> Self: def __enter__(self) -> "AudioConverter":
""" """
Audio converter context manager. Audio converter context manager.

View file

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