Mercurial > public > mercurial-scm > hg
comparison mercurial/wireprotoframing.py @ 37474:d33997123ea5
py3: system-stringify repr(frame)
That's the Py3 requirement.
author | Yuya Nishihara <yuya@tcha.org> |
---|---|
date | Sun, 08 Apr 2018 11:23:55 +0900 |
parents | 7c2c7c749411 |
children | e9dea82ea1f3 |
comparison
equal
deleted
inserted
replaced
37473:7c2c7c749411 | 37474:d33997123ea5 |
---|---|
17 from .thirdparty import ( | 17 from .thirdparty import ( |
18 attr, | 18 attr, |
19 cbor, | 19 cbor, |
20 ) | 20 ) |
21 from . import ( | 21 from . import ( |
22 encoding, | |
22 error, | 23 error, |
23 util, | 24 util, |
24 ) | 25 ) |
25 from .utils import ( | 26 from .utils import ( |
26 stringutil, | 27 stringutil, |
140 streamflags = attr.ib() | 141 streamflags = attr.ib() |
141 typeid = attr.ib() | 142 typeid = attr.ib() |
142 flags = attr.ib() | 143 flags = attr.ib() |
143 payload = attr.ib() | 144 payload = attr.ib() |
144 | 145 |
146 @encoding.strmethod | |
145 def __repr__(self): | 147 def __repr__(self): |
146 typename = '<unknown 0x%02x>' % self.typeid | 148 typename = '<unknown 0x%02x>' % self.typeid |
147 for name, value in FRAME_TYPES.iteritems(): | 149 for name, value in FRAME_TYPES.iteritems(): |
148 if value == self.typeid: | 150 if value == self.typeid: |
149 typename = name | 151 typename = name |