Mercurial > hg
comparison mercurial/keepalive.py @ 40426:588f1e9a4d16 stable
http: work around custom http client classes that refuse extra attrs
I have no idea what is going on with our custom http client code at Google,
but it chokes on these extra attributes we're tucking on http clients. Since
it feels more than a little wrong to just stuff extra data on a client, let's
degrade gracefully when the client class refuses the attributes.
author | Augie Fackler <augie@google.com> |
---|---|
date | Mon, 29 Oct 2018 16:23:42 -0400 |
parents | 41506e3b04ee |
children | 348352658e4b |
comparison
equal
deleted
inserted
replaced
40422:7e4ffe2719e4 | 40426:588f1e9a4d16 |
---|---|
440 s = self._rbuf | 440 s = self._rbuf |
441 self._rbuf = '' | 441 self._rbuf = '' |
442 data = self._raw_read(amt) | 442 data = self._raw_read(amt) |
443 | 443 |
444 self.receivedbytescount += len(data) | 444 self.receivedbytescount += len(data) |
445 self._connection.receivedbytescount += len(data) | 445 try: |
446 self._connection.receivedbytescount += len(data) | |
447 except AttributeError: | |
448 pass | |
446 try: | 449 try: |
447 self._handler.parent.receivedbytescount += len(data) | 450 self._handler.parent.receivedbytescount += len(data) |
448 except AttributeError: | 451 except AttributeError: |
449 pass | 452 pass |
450 | 453 |