From 52c6ba8880363ba5d82b5e767559afbc72371272 Mon Sep 17 00:00:00 2001 From: Maximilian Hils Date: Thu, 15 May 2014 18:15:29 +0200 Subject: [PATCH] properly subclass Exception in HTTPError --- netlib/http.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/netlib/http.py b/netlib/http.py index 51f85627c..f5b8118aa 100644 --- a/netlib/http.py +++ b/netlib/http.py @@ -1,15 +1,15 @@ import string, urlparse, binascii import odict, utils + class HttpError(Exception): - def __init__(self, code, msg): - self.code, self.msg = code, msg - - def __str__(self): - return "HttpError(%s, %s)"%(self.code, self.msg) + def __init__(self, code, message): + super(HttpError, self).__init__(message) + self.code = code -class HttpErrorConnClosed(HttpError): pass +class HttpErrorConnClosed(HttpError): + pass def _is_valid_port(port):