Skip to content

Commit

Permalink
Merge pull request #117 from Bomme/subprocess_devnull
Browse files Browse the repository at this point in the history
no need to use os.devnull directly since python3.3
  • Loading branch information
sampsyo committed Dec 3, 2021
2 parents bfc3fec + 14f1640 commit 5afc8a6
Showing 1 changed file with 1 addition and 7 deletions.
8 changes: 1 addition & 7 deletions audioread/ffdec.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@
output.
"""

import os
import queue
import re
import subprocess
Expand Down Expand Up @@ -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,
)

Expand Down Expand Up @@ -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()

Expand Down

0 comments on commit 5afc8a6

Please sign in to comment.