Fix --extract-audio on Python 3
[youtube-dl] / youtube_dl / utils.py
index 44f939053adf5fcf6a2ab1ad4cb9c0eac5cedd7a..25b67db0665af756ee32dac797f18a647004ff1f 100644 (file)
@@ -51,6 +51,12 @@ try:
 except ImportError: # Python 2
     import httplib as compat_http_client
 
+try:
+    from subprocess import DEVNULL
+    compat_subprocess_get_DEVNULL = lambda: DEVNULL
+except ImportError:
+    compat_subprocess_get_DEVNULL = lambda: open(os.path.devnull, 'w')
+
 try:
     from urllib.parse import parse_qs as compat_parse_qs
 except ImportError: # Python 2