Skip to content

Commit 5afc8a6

Browse files
authored
Merge pull request #117 from Bomme/subprocess_devnull
no need to use os.devnull directly since python3.3
2 parents bfc3fec + 14f1640 commit 5afc8a6

File tree

1 file changed

+1
-7
lines changed

1 file changed

+1
-7
lines changed

audioread/ffdec.py

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@
1616
output.
1717
"""
1818

19-
import os
2019
import queue
2120
import re
2221
import subprocess
@@ -139,13 +138,12 @@ def __init__(self, filename, block_size=DEFAULT_BUFFER_SIZE):
139138
)
140139

141140
try:
142-
self.devnull = open(os.devnull)
143141
self.proc = popen_multiple(
144142
COMMANDS,
145143
['-i', filename, '-f', 's16le', '-'],
146144
stdout=subprocess.PIPE,
147145
stderr=subprocess.PIPE,
148-
stdin=self.devnull,
146+
stdin=subprocess.DEVNULL,
149147
creationflags=PROC_FLAGS,
150148
)
151149

@@ -305,10 +303,6 @@ def close(self):
305303
self.proc.stdout.close()
306304
self.proc.stderr.close()
307305

308-
# Close the handle to os.devnull, which is opened regardless of if
309-
# a subprocess is successfully created.
310-
self.devnull.close()
311-
312306
def __del__(self):
313307
self.close()
314308

0 commit comments

Comments
 (0)