Don't reference Exception.message due to deprecation in Python 2.6
This commit is contained in:
parent
6b07e69551
commit
9c51d01b12
|
@ -310,14 +310,8 @@ class HTTPResponse(object):
|
|||
class HTTPError(Exception):
|
||||
def __init__(self, code, message=None):
|
||||
self.code = code
|
||||
Exception.__init__(self, "HTTP %d" % self.code)
|
||||
|
||||
def __repr__(self):
|
||||
return "%s(%r)" % (self.__class__.__name__, self.code)
|
||||
|
||||
def __str__(self):
|
||||
return "%d: %s" % (self.code, httplib.responses.get(
|
||||
self.code, "Unknown"))
|
||||
message = message or httplib.responses.get(code, "Unknown")
|
||||
Exception.__init__(self, "HTTP %d: %s" % (self.code, message))
|
||||
|
||||
|
||||
class CurlError(HTTPError):
|
||||
|
@ -325,13 +319,6 @@ class CurlError(HTTPError):
|
|||
HTTPError.__init__(self, 599, message)
|
||||
self.errno = errno
|
||||
|
||||
def __repr__(self):
|
||||
return "%s(%r,%r)" % (self.__class__.__name__, self.errno,
|
||||
self.message)
|
||||
|
||||
def __str__(self):
|
||||
return "%d: %s" % (self.errno, self.message)
|
||||
|
||||
|
||||
def _curl_create(max_simultaneous_connections=None):
|
||||
curl = pycurl.Curl()
|
||||
|
|
Loading…
Reference in New Issue