# HG changeset patch # User Yuya Nishihara # Date 2017-09-03 05:37:25 # Node ID 708b5530a273ab50594fa2eab5e8ebfdea7b48a0 # Parent 2648725443624ba3137d74c7a99bf71b7d3df6dd doctest: replace chr() with pycompat.bytechr() diff --git a/mercurial/changelog.py b/mercurial/changelog.py --- a/mercurial/changelog.py +++ b/mercurial/changelog.py @@ -27,6 +27,7 @@ from . import ( def _string_escape(text): """ + >>> from .pycompat import bytechr as chr >>> d = {b'nl': chr(10), b'bs': chr(92), b'cr': chr(13), b'nul': chr(0)} >>> s = b"ab%(nl)scd%(bs)s%(bs)sn%(nul)sab%(cr)scd%(bs)s%(nl)s" % d >>> s @@ -41,6 +42,7 @@ def _string_escape(text): def decodeextra(text): """ + >>> from .pycompat import bytechr as chr >>> sorted(decodeextra(encodeextra({b'foo': b'bar', b'baz': chr(0) + b'2'}) ... ).items()) [('baz', '\\x002'), ('branch', 'default'), ('foo', 'bar')]