diff --git a/audioread/ffdec.py b/audioread/ffdec.py index 40e9aa6..273b813 100644 --- a/audioread/ffdec.py +++ b/audioread/ffdec.py @@ -16,7 +16,6 @@ output. """ -import os import queue import re import subprocess @@ -139,13 +138,12 @@ def __init__(self, filename, block_size=DEFAULT_BUFFER_SIZE): ) try: - self.devnull = open(os.devnull) self.proc = popen_multiple( COMMANDS, ['-i', filename, '-f', 's16le', '-'], stdout=subprocess.PIPE, stderr=subprocess.PIPE, - stdin=self.devnull, + stdin=subprocess.DEVNULL, creationflags=PROC_FLAGS, ) @@ -305,10 +303,6 @@ def close(self): self.proc.stdout.close() self.proc.stderr.close() - # Close the handle to os.devnull, which is opened regardless of if - # a subprocess is successfully created. - self.devnull.close() - def __del__(self): self.close()