commit 0a3c8b6291bb9750115f5188c8500e624c5ab449
parent 134cff47abe76b180d9a6cd9e9afc364eb52f332
Author: Philipp Hagemeister <phihag@phihag.de>
Date: Sat, 6 Aug 2011 11:47:53 +0200
Use alternative imports for Python 2.4 (Closes #138)
Diffstat:
1 file changed, 7 insertions(+), 2 deletions(-)
diff --git a/youtube-dl b/youtube-dl
@@ -12,9 +12,7 @@
from __future__ import with_statement
import contextlib
import cookielib
-import ctypes
import datetime
-import email.utils
import gzip
import htmlentitydefs
import httplib
@@ -34,6 +32,13 @@ import urllib2
import warnings
import zlib
+if os.name == 'nt':
+ import ctypes
+
+try:
+ import email.utils
+except ImportError: # Python 2.4
+ import email.Utils
try:
import cStringIO as StringIO
except ImportError: