summaryrefslogtreecommitdiffstats
path: root/pyload/network/HTTPRequest.py
diff options
context:
space:
mode:
Diffstat (limited to 'pyload/network/HTTPRequest.py')
-rw-r--r--pyload/network/HTTPRequest.py11
1 files changed, 5 insertions, 6 deletions
diff --git a/pyload/network/HTTPRequest.py b/pyload/network/HTTPRequest.py
index 22a4cc604..e450cacfe 100644
--- a/pyload/network/HTTPRequest.py
+++ b/pyload/network/HTTPRequest.py
@@ -3,15 +3,14 @@
from __future__ import with_statement
+import cStringIO
import codecs
+import httplib
import logging
import urllib
import pycurl
-from httplib import responses
-from cStringIO import StringIO
-
from pyload.plugin.Plugin import Abort, Fail
from pyload.utils import encode
@@ -31,7 +30,7 @@ bad_headers = range(400, 404) + range(405, 418) + range(500, 506)
class BadHeader(Exception):
def __init__(self, code, content=""):
- Exception.__init__(self, "Bad server response: %s %s" % (code, responses[int(code)]))
+ Exception.__init__(self, "Bad server response: %s %s" % (code, httplib.responses[int(code)]))
self.code = code
self.content = content
@@ -40,7 +39,7 @@ class HTTPRequest(object):
def __init__(self, cookies=None, options=None):
self.c = pycurl.Curl()
- self.rep = StringIO()
+ self.rep = cStringIO.StringIO()
self.cj = cookies #: cookiejar
@@ -244,7 +243,7 @@ class HTTPRequest(object):
else:
value = self.rep.getvalue()
self.rep.close()
- self.rep = StringIO()
+ self.rep = cStringIO.StringIO()
return value