From: Ricardo Garcia Date: Thu, 20 Jan 2011 19:36:42 +0000 (+0100) Subject: Improve addinfourl_wrapper for compatibility with older Python versions X-Git-Url: http://git.oshgnacknak.de/?a=commitdiff_plain;h=0f6b00b587e9b47919555f9c250b753419063b46;p=youtube-dl Improve addinfourl_wrapper for compatibility with older Python versions --- diff --git a/youtube-dl b/youtube-dl index 1b20025e7..103189b21 100755 --- a/youtube-dl +++ b/youtube-dl @@ -193,7 +193,9 @@ class YoutubeDLHandler(urllib2.HTTPHandler): def addinfourl_wrapper(stream, headers, url, code): if hasattr(urllib2.addinfourl, 'getcode'): return urllib2.addinfourl(stream, headers, url, code) - return urllib2.addinfourl(stream, headers, url) + ret = urllib2.addinfourl(stream, headers, url) + ret.code = code + return ret def http_request(self, req): for h in std_headers: