Browse Source

Ensure FFmpeg players have a _process attribute set even during errors

pull/8342/head
Rapptz 3 years ago
parent
commit
54541ba6f0
  1. 4
      discord/player.py

4
discord/player.py

@ -161,7 +161,9 @@ class FFmpegAudio(AudioSource):
kwargs = {'stdout': subprocess.PIPE} kwargs = {'stdout': subprocess.PIPE}
kwargs.update(subprocess_kwargs) kwargs.update(subprocess_kwargs)
self._process: subprocess.Popen = self._spawn_process(args, **kwargs) # Ensure attribute is assigned even in the case of errors
self._process: subprocess.Popen = MISSING
self._process = self._spawn_process(args, **kwargs)
self._stdout: IO[bytes] = self._process.stdout # type: ignore # process stdout is explicitly set self._stdout: IO[bytes] = self._process.stdout # type: ignore # process stdout is explicitly set
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

Loading…
Cancel
Save