From 77f7cd8b9084c75f2a170704dbc0b193d96e91d3 Mon Sep 17 00:00:00 2001 From: Fabio Manganiello Date: Tue, 27 Jun 2023 14:15:55 +0200 Subject: [PATCH] Don't use typing.Self (yet). typing.Self has only been introduced in Python 3.10. --- platypush/plugins/sound/_converters/_base.py | 4 ++-- platypush/plugins/sound/_streams/_player/_base.py | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/platypush/plugins/sound/_converters/_base.py b/platypush/plugins/sound/_converters/_base.py index 1a738f3ac9..efa19fcf44 100644 --- a/platypush/plugins/sound/_converters/_base.py +++ b/platypush/plugins/sound/_converters/_base.py @@ -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. diff --git a/platypush/plugins/sound/_streams/_player/_base.py b/platypush/plugins/sound/_streams/_player/_base.py index b2a324a2d3..6b4a122125 100644 --- a/platypush/plugins/sound/_streams/_player/_base.py +++ b/platypush/plugins/sound/_streams/_player/_base.py @@ -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