Browse Source

Fix some minor typing issues

pull/7494/head
Rapptz 3 years ago
parent
commit
2c89202214
  1. 4
      discord/player.py
  2. 4
      discord/utils.py

4
discord/player.py

@ -151,7 +151,7 @@ class FFmpegAudio(AudioSource):
self._process: subprocess.Popen = self._spawn_process(args, **kwargs)
self._stdout: IO[bytes] = self._process.stdout # type: ignore
self._stdin: Optional[IO[Bytes]] = None
self._stdin: Optional[IO[bytes]] = None
self._pipe_thread: Optional[threading.Thread] = None
if piping:
@ -200,7 +200,7 @@ class FFmpegAudio(AudioSource):
self._process.terminate()
return
try:
self._stdin.write(data)
self._stdin.write(data) # type: ignore
except Exception:
_log.debug('Write error for %s, this is probably not a problem', self, exc_info=True)
# at this point the source data is either exhausted or the process is fubar

4
discord/utils.py

@ -187,7 +187,7 @@ def cached_slot_property(name: str) -> Callable[[Callable[[T], T_co]], CachedSlo
return decorator
class SequenceProxy(Generic[T_co], collections.abc.Sequence):
class SequenceProxy(collections.abc.Sequence[T_co]):
"""Read-only proxy of a Sequence."""
def __init__(self, proxied: Sequence[T_co]):
@ -538,7 +538,7 @@ async def sane_wait_for(futures, *, timeout):
def get_slots(cls: Type[Any]) -> Iterator[str]:
for mro in reversed(cls.__mro__):
try:
yield from mro.__slots__
yield from mro.__slots__ # type: ignore
except AttributeError:
continue

Loading…
Cancel
Save