Fix possible FFmpegAudio AttributeError in __del__

This commit is contained in:
Imayhaveborkedit
2023-09-20 17:13:50 -04:00
committed by GitHub
parent 97ae6409b0
commit dacf3cfe86

View File

@ -212,7 +212,8 @@ class FFmpegAudio(AudioSource):
return process
def _kill_process(self) -> None:
proc = self._process
# this function gets called in __del__ so instance attributes might not even exist
proc = getattr(self, '_process', MISSING)
if proc is MISSING:
return