class HTTPException(Exception):
+ # Subclasses that define an __init__ must call Exception.__init__
+ # or define self.args. Otherwise, str() will fail.
pass
class NotConnected(HTTPException):
class UnknownProtocol(HTTPException):
def __init__(self, version):
+ self.args = version,
self.version = version
class UnknownTransferEncoding(HTTPException):
class IncompleteRead(HTTPException):
def __init__(self, partial):
+ self.args = partial,
self.partial = partial
class ImproperConnectionState(HTTPException):
class BadStatusLine(HTTPException):
def __init__(self, line):
+ self.args = line,
self.line = line
# for backwards compatibility
r = c.getresponse()
except BadStatusLine, err:
print "strict mode failed as expected"
+ print err
else:
print "XXX strict mode should have failed"