From 5910e210f48826c6d078ef3744b25d209535c3ae Mon Sep 17 00:00:00 2001 From: Philipp Hagemeister Date: Sun, 16 Dec 2012 12:29:03 +0100 Subject: Fix --extract-audio on Python 3 --- youtube_dl/utils.py | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'youtube_dl/utils.py') diff --git a/youtube_dl/utils.py b/youtube_dl/utils.py index 44f939053..25b67db06 100644 --- a/youtube_dl/utils.py +++ b/youtube_dl/utils.py @@ -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 -- cgit v1.2.3