From 304a42b914cde43a31a935181b0f952c726eee54 Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Tue, 12 May 2015 14:03:56 +0200 Subject: Other import fixes (2) --- pyload/network/HTTPRequest.py | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) (limited to 'pyload/network') 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 -- cgit v1.2.3