changeset 34256:ebe3d0095c69

py3: convert system strings to bytes in doctest of formatter.py
author Yuya Nishihara <yuya@tcha.org>
date Sun, 17 Sep 2017 12:39:53 +0900
parents d6af8da4a3b8
children 2844c4bd5a39
files mercurial/formatter.py tests/test-doctest.py
diffstat 2 files changed, 3 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/mercurial/formatter.py	Sun Sep 17 12:39:14 2017 +0900
+++ b/mercurial/formatter.py	Sun Sep 17 12:39:53 2017 +0900
@@ -48,7 +48,8 @@
 ...     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='')
 
--- a/tests/test-doctest.py	Sun Sep 17 12:39:14 2017 +0900
+++ b/tests/test-doctest.py	Sun Sep 17 12:39:53 2017 +0900
@@ -51,7 +51,7 @@
 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')