mercurial/httppeer.py
changeset 30484 d1b97fc87f55
parent 30475 ef9f197188ec
child 30564 07bcd1bf6151
equal deleted inserted replaced
30483:8491845a75b2 30484:d1b97fc87f55
    37     except httplib.HTTPException:
    37     except httplib.HTTPException:
    38         raise IOError(None, _('connection ended unexpectedly'))
    38         raise IOError(None, _('connection ended unexpectedly'))
    39 
    39 
    40     # We need to wrap reader.read() so HTTPException on subsequent
    40     # We need to wrap reader.read() so HTTPException on subsequent
    41     # reads is also converted.
    41     # reads is also converted.
       
    42     # Ideally we'd use super() here. However, if ``reader`` isn't a new-style
       
    43     # class, this can raise:
       
    44     # TypeError: super() argument 1 must be type, not classobj
    42     origread = reader.read
    45     origread = reader.read
    43     class readerproxy(reader.__class__):
    46     class readerproxy(reader.__class__):
    44         def read(self, *args, **kwargs):
    47         def read(self, *args, **kwargs):
    45             try:
    48             try:
    46                 return origread(*args, **kwargs)
    49                 return origread(*args, **kwargs)