wireproto: fix repr(frame) to not crash by unknown type id
authorYuya Nishihara <yuya@tcha.org>
Sun, 08 Apr 2018 11:14:47 +0900
changeset 37472 2f81926c7f89
parent 37471 51d5e1ff0613
child 37473 7c2c7c749411
wireproto: fix repr(frame) to not crash by unknown type id Follows up 5ef2da00e935.
mercurial/wireprotoframing.py
--- a/mercurial/wireprotoframing.py	Sun Apr 08 15:39:08 2018 +0900
+++ b/mercurial/wireprotoframing.py	Sun Apr 08 11:14:47 2018 +0900
@@ -150,7 +150,7 @@
                 'type=%s; flags=%s)' % (
             len(self.payload), self.requestid, self.streamid,
             humanflags(STREAM_FLAGS, self.streamflags), typename,
-            humanflags(FRAME_TYPE_FLAGS[self.typeid], self.flags)))
+            humanflags(FRAME_TYPE_FLAGS.get(self.typeid, {}), self.flags)))
 
 def makeframe(requestid, streamid, streamflags, typeid, flags, payload):
     """Assemble a frame into a byte array."""