# HG changeset patch # User Yuya Nishihara # Date 2017-09-17 03:39:53 # Node ID ebe3d0095c694e0bff167da84c0d14fb6d4ad9ac # Parent d6af8da4a3b87fdfd21301c44badd7c8443a2d08 py3: convert system strings to bytes in doctest of formatter.py diff --git a/mercurial/formatter.py b/mercurial/formatter.py --- a/mercurial/formatter.py +++ b/mercurial/formatter.py @@ -48,7 +48,8 @@ Doctest helper: ... ui.verbose = verbose ... ui.pushbuffer() ... try: -... return fn(ui, ui.formatter(fn.__name__, opts)) +... return fn(ui, ui.formatter(pycompat.sysbytes(fn.__name__), +... pycompat.byteskwargs(opts))) ... finally: ... print(pycompat.sysstr(ui.popbuffer()), end='') diff --git a/tests/test-doctest.py b/tests/test-doctest.py --- a/tests/test-doctest.py +++ b/tests/test-doctest.py @@ -51,7 +51,7 @@ testmod('mercurial.context') testmod('mercurial.dagparser', optionflags=doctest.NORMALIZE_WHITESPACE) testmod('mercurial.dispatch') testmod('mercurial.encoding') -testmod('mercurial.formatter', py3=False) # py3: write bytes to stdout +testmod('mercurial.formatter') testmod('mercurial.hg') testmod('mercurial.hgweb.hgwebdir_mod', py3=False) # py3: repr(bytes) ? testmod('mercurial.match')