mirror of
https://github.com/ankitects/anki.git
synced 2025-09-19 06:22:22 -04:00
Fix ResourceWarning: unclosed file <_io.BufferedWriter name=5>
https://forums.ankiweb.net/t/aqt-sound-py-resourcewarning-unclosed-file-io-bufferedwriter-name-5/13070
This commit is contained in:
parent
9f0929db32
commit
133e22dbe4
1 changed files with 2 additions and 0 deletions
|
@ -321,6 +321,8 @@ class SimpleProcessPlayer(Player): # pylint: disable=abstract-method
|
||||||
self._process.wait(0.1)
|
self._process.wait(0.1)
|
||||||
if self._process.returncode != 0:
|
if self._process.returncode != 0:
|
||||||
print(f"player got return code: {self._process.returncode}")
|
print(f"player got return code: {self._process.returncode}")
|
||||||
|
if self._process.stdin:
|
||||||
|
self._process.stdin.close()
|
||||||
self._process = None
|
self._process = None
|
||||||
return
|
return
|
||||||
except subprocess.TimeoutExpired:
|
except subprocess.TimeoutExpired:
|
||||||
|
|
Loading…
Reference in a new issue