aboutsummaryrefslogtreecommitdiff
path: root/youtube_dl/utils.py
diff options
context:
space:
mode:
authorPhilipp Hagemeister <phihag@phihag.de>2012-11-28 00:17:12 +0100
committerPhilipp Hagemeister <phihag@phihag.de>2012-11-28 00:17:12 +0100
commit9f37a9594147b71b1ce796219f75fc3a2bb544d3 (patch)
treeffa94d68ab9203dd6caf7f0b25f4de46cae9fbb9 /youtube_dl/utils.py
parenta130bc6d024e9bfa3c7f8742f8bf5038b2c6e363 (diff)
downloadyoutube-dl-9f37a9594147b71b1ce796219f75fc3a2bb544d3.tar.xz
Py2/3 parse_qs compatibility
Diffstat (limited to 'youtube_dl/utils.py')
-rw-r--r--youtube_dl/utils.py10
1 files changed, 7 insertions, 3 deletions
diff --git a/youtube_dl/utils.py b/youtube_dl/utils.py
index 370567705..a27ac77dd 100644
--- a/youtube_dl/utils.py
+++ b/youtube_dl/utils.py
@@ -33,19 +33,23 @@ except ImportError: # Python 2
try:
import html.entities as compat_html_entities
-except NameError: # Python 2
+except ImportError: # Python 2
import htmlentitydefs as compat_html_entities
try:
import html.parser as compat_html_parser
-except NameError: # Python 2
+except ImportError: # Python 2
import HTMLParser as compat_html_parser
try:
import http.client as compat_html_client
-except NameError: # Python 2
+except ImportError: # Python 2
import httplib as compat_html_client
+try:
+ from urllib.parse.parse_qs import parse_qs as compat_parse_qs
+except ImportError: # Python 2
+ from urlparse import parse_qs as compat_parse_qs
try:
compat_str = unicode # Python 2