Show More
@@ -32,11 +32,7 b' class httprangereader(object):' | |||
|
32 | 32 | try: |
|
33 | 33 | f = self.opener.open(req) |
|
34 | 34 | data = f.read() |
|
35 | # Python 2.6+ defines a getcode() function, and 2.4 and | |
|
36 | # 2.5 appear to always have an undocumented code attribute | |
|
37 | # set. If we can't read either of those, fall back to 206 | |
|
38 | # and hope for the best. | |
|
39 | code = getattr(f, 'getcode', lambda : getattr(f, 'code', 206))() | |
|
35 | code = f.code | |
|
40 | 36 | except urllib2.HTTPError, inst: |
|
41 | 37 | num = inst.code == 404 and errno.ENOENT or None |
|
42 | 38 | raise IOError(num, inst) |
General Comments 0
You need to be logged in to leave comments.
Login now