[PATCH 3 of 5] py3: system-stringify repr(frame)

Yuya Nishihara yuya at tcha.org
Sun Apr 8 04:59:43 EDT 2018


# HG changeset patch
# User Yuya Nishihara <yuya at tcha.org>
# Date 1523154235 -32400
#      Sun Apr 08 11:23:55 2018 +0900
# Node ID 9a35569ef5ab58c975f56ecb063a1b82b25ec6b8
# Parent  bb8635c7a6c30b988e9439ed9057857250838a7a
py3: system-stringify repr(frame)

That's the Py3 requirement.

diff --git a/mercurial/wireprotoframing.py b/mercurial/wireprotoframing.py
--- a/mercurial/wireprotoframing.py
+++ b/mercurial/wireprotoframing.py
@@ -19,6 +19,7 @@ from .thirdparty import (
     cbor,
 )
 from . import (
+    encoding,
     error,
     util,
 )
@@ -142,6 +143,7 @@ class frame(object):
     flags = attr.ib()
     payload = attr.ib()
 
+    @encoding.strmethod
     def __repr__(self):
         typename = '<unknown 0x%02x>' % self.typeid
         for name, value in FRAME_TYPES.iteritems():


More information about the Mercurial-devel mailing list