D4591: py3: suppress the return value from .write() call

pulkit (Pulkit Goyal) phabricator at mercurial-scm.org
Fri Sep 14 18:16:20 EDT 2018


This revision was automatically updated to reflect the committed changes.
Closed by commit rHG2f40bcebad30: py3: suppress the return value from .write() call (authored by pulkit, committed by ).

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D4591?vs=11045&id=11052

REVISION DETAIL
  https://phab.mercurial-scm.org/D4591

AFFECTED FILES
  tests/test-convert-mtn.t
  tests/test-diff-color.t

CHANGE DETAILS

diff --git a/tests/test-diff-color.t b/tests/test-diff-color.t
--- a/tests/test-diff-color.t
+++ b/tests/test-diff-color.t
@@ -57,7 +57,7 @@
   >>> with open('a', 'rb') as f:
   ...     data = f.read()
   >>> with open('a', 'wb') as f:
-  ...     f.write(data.replace(b'dd', b'dd \r'))
+  ...     f.write(data.replace(b'dd', b'dd \r')) and None
   $ hg diff --nodates
   \x1b[0;1mdiff -r cf9f4ba66af2 a\x1b[0m (esc)
   \x1b[0;31;1m--- a/a\x1b[0m (esc)
diff --git a/tests/test-convert-mtn.t b/tests/test-convert-mtn.t
--- a/tests/test-convert-mtn.t
+++ b/tests/test-convert-mtn.t
@@ -43,7 +43,7 @@
   $ mkdir dir
   $ echo b > dir/b
   $ echo d > dir/d
-  $ $PYTHON -c 'open("bin", "wb").write(b"a\\x00b")'
+  $ $PYTHON -c 'open("bin", "wb").write(b"a\\x00b") and None'
   $ echo c > c
   $ mtn add a dir/b dir/d c bin
   mtn: adding 'a' to workspace manifest
@@ -65,7 +65,7 @@
   $ echo b >> dir/b
   $ mtn drop c
   mtn: dropping 'c' from workspace manifest
-  $ $PYTHON -c 'open("bin", "wb").write(b"b\\x00c")'
+  $ $PYTHON -c 'open("bin", "wb").write(b"b\\x00c") and None'
   $ mtn ci -m update1
   mtn: beginning commit on branch 'com.selenic.test'
   mtn: committed revision 51d0a982464573a2a2cf5ee2c9219c652aaebeff
@@ -218,7 +218,7 @@
 test large file support (> 32kB)
 
   >>> fp = open('large-file', 'wb')
-  >>> for x in range(10000): fp.write(b'%d\n' % x)
+  >>> for x in range(10000): fp.write(b'%d\n' % x) and None
   >>> fp.close()
   $ md5sum.py large-file
   5d6de8a95c3b6bf9e0ffb808ba5299c1  large-file



To: pulkit, #hg-reviewers
Cc: mercurial-devel


More information about the Mercurial-devel mailing list