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._process: subprocess.Popen = self._spawn_process(args, **kwargs)
self._stdout: IO[bytes] = self._process.stdout # type: ignore 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 self._pipe_thread: Optional[threading.Thread] = None
if piping: if piping:
@ -200,7 +200,7 @@ class FFmpegAudio(AudioSource):
self._process.terminate() self._process.terminate()
return return
try: try:
self._stdin.write(data) self._stdin.write(data) # type: ignore
except Exception: except Exception:
_log.debug('Write error for %s, this is probably not a problem', self, exc_info=True) _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 # 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 return decorator
class SequenceProxy(Generic[T_co], collections.abc.Sequence): class SequenceProxy(collections.abc.Sequence[T_co]):
"""Read-only proxy of a Sequence.""" """Read-only proxy of a Sequence."""
def __init__(self, proxied: Sequence[T_co]): 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]: def get_slots(cls: Type[Any]) -> Iterator[str]:
for mro in reversed(cls.__mro__): for mro in reversed(cls.__mro__):
try: try:
yield from mro.__slots__ yield from mro.__slots__ # type: ignore
except AttributeError: except AttributeError:
continue continue

Loading…
Cancel
Save