Mercurial > hg
comparison mercurial/httppeer.py @ 37669:1cb54e6193a6
py3: paper over differences in future exception handling
It looks like Python 3's futures library lacks set_exception_info
entirely. We'll just give up and use set_exception in that case.
# no-check-commit because the underbar naming is just saner here
Differential Revision: https://phab.mercurial-scm.org/D3336
author | Augie Fackler <augie@google.com> |
---|---|
date | Fri, 13 Apr 2018 18:17:45 -0400 |
parents | 8cea0d57bf37 |
children | 0664be4f0c1f |
comparison
equal
deleted
inserted
replaced
37668:2a42ca2679e2 | 37669:1cb54e6193a6 |
---|---|
752 decoder = cbor.CBORDecoder(payload) | 752 decoder = cbor.CBORDecoder(payload) |
753 while payload.tell() + 1 < len(meta['data']): | 753 while payload.tell() + 1 < len(meta['data']): |
754 try: | 754 try: |
755 result.append(decoder.decode()) | 755 result.append(decoder.decode()) |
756 except Exception: | 756 except Exception: |
757 f.set_exception_info(*sys.exc_info()[1:]) | 757 pycompat.future_set_exception_info( |
758 f, sys.exc_info()[1:]) | |
758 continue | 759 continue |
759 else: | 760 else: |
760 result.append(meta['data']) | 761 result.append(meta['data']) |
761 | 762 |
762 if meta['eos']: | 763 if meta['eos']: |