Patchwork [03,of,11] doctest: replace chr() with pycompat.bytechr()

login
register
mail settings
Submitter Yuya Nishihara
Date Sept. 4, 2017, 3:08 p.m.
Message ID <d6b27bb3e05c2a26c7c3.1504537702@mimosa>
Download mbox | patch
Permalink /patch/23658/
State Accepted
Headers show

Comments

Yuya Nishihara - Sept. 4, 2017, 3:08 p.m.
# HG changeset patch
# User Yuya Nishihara <yuya@tcha.org>
# Date 1504417045 -32400
#      Sun Sep 03 14:37:25 2017 +0900
# Node ID d6b27bb3e05c2a26c7c34e814c6e7e71e8b866cf
# Parent  946edb712b2fb76364f9f2e24b284ddb86dd8013
doctest: replace chr() with pycompat.bytechr()

Patch

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')]