diff mercurial/patch.py @ 34137:a8994d08e4a2

doctest: use print_function and convert bytes to unicode where needed
author Yuya Nishihara <yuya@tcha.org>
date Sun, 03 Sep 2017 14:56:31 +0900
parents 0fa781320203
children 61714510220d
line wrap: on
line diff
--- a/mercurial/patch.py	Sun Sep 03 15:47:17 2017 +0900
+++ b/mercurial/patch.py	Sun Sep 03 14:56:31 2017 +0900
@@ -6,7 +6,7 @@
 # This software may be used and distributed according to the terms of the
 # GNU General Public License version 2 or any later version.
 
-from __future__ import absolute_import
+from __future__ import absolute_import, print_function
 
 import collections
 import copy
@@ -1505,7 +1505,7 @@
     ...      c.write(fp)
     >>> fp.seek(0)
     >>> reversedpatch = fp.read()
-    >>> print reversedpatch
+    >>> print(pycompat.sysstr(reversedpatch))
     diff --git a/folder1/g b/folder1/g
     --- a/folder1/g
     +++ b/folder1/g
@@ -1562,7 +1562,7 @@
     ...     header.write(out)
     ...     for hunk in header.hunks:
     ...         hunk.write(out)
-    >>> print(out.getvalue())
+    >>> print(pycompat.sysstr(out.getvalue()))
     diff --git a/folder1/g b/folder1/g
     --- a/folder1/g
     +++ b/folder1/g