aboutsummaryrefslogtreecommitdiff
path: root/youtube_dl/utils.py
diff options
context:
space:
mode:
authorPhilipp Hagemeister <phihag@phihag.de>2012-12-16 12:29:03 +0100
committerPhilipp Hagemeister <phihag@phihag.de>2012-12-16 12:29:03 +0100
commit5910e210f48826c6d078ef3744b25d209535c3ae (patch)
treed6745ed1f4d45f3c5fe3b6211bc2801f6518a2fd /youtube_dl/utils.py
parentb375c8b9469a94a4c8f0c8acc1558d2d6005f01b (diff)
Fix --extract-audio on Python 3
Diffstat (limited to 'youtube_dl/utils.py')
-rw-r--r--youtube_dl/utils.py6
1 files changed, 6 insertions, 0 deletions
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
@@ -52,6 +52,12 @@ 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
# HACK: The following is the correct parse_qs implementation from cpython 3's stdlib.