changeset 37367:87c4253bebdb

py3: suppress the output of open() using `and None` This patch suppresses the output of open() on Python 3 as it does not return any output on Python 2. This makes test-diffstat.t pass on Python 3.5 Differential Revision: https://phab.mercurial-scm.org/D3128
author Pulkit Goyal <7895pulkit@gmail.com>
date Thu, 05 Apr 2018 17:00:15 +0530
parents b23e3cc1afd4
children cdccfe20eed7
files tests/test-diffstat.t
diffstat 1 files changed, 2 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/tests/test-diffstat.t	Thu Apr 05 16:56:34 2018 +0530
+++ b/tests/test-diffstat.t	Thu Apr 05 17:00:15 2018 +0530
@@ -35,7 +35,7 @@
 
   $ hg ci -m appenda
 
-  >>> open("c", "wb").write(b"\0")
+  >>> open("c", "wb").write(b"\0") and None
   $ touch d
   $ hg add c d
 
@@ -54,7 +54,7 @@
 
   $ hg ci -m createb
 
-  >>> open("file with spaces", "wb").write(b"\0")
+  >>> open("file with spaces", "wb").write(b"\0") and None
   $ hg add "file with spaces"
 
 Filename with spaces diffstat: