py3: add `and None` to suppress return values of .write() calls
authorPulkit Goyal <7895pulkit@gmail.com>
Mon, 18 Jun 2018 16:07:46 +0530
changeset 38371 fb4813304c5f
parent 38370 c7eb9bce6041
child 38372 f4f1fb1cbfb4
py3: add `and None` to suppress return values of .write() calls .write() calls don't return anything on Python2, so we need to make sure we suppress that on py3 too. This makes the test pass on Python 3. Differential Revision: https://phab.mercurial-scm.org/D3793
contrib/python3-whitelist
tests/test-transplant.t
--- a/contrib/python3-whitelist	Mon Jun 18 16:06:28 2018 +0530
+++ b/contrib/python3-whitelist	Mon Jun 18 16:07:46 2018 +0530
@@ -490,6 +490,7 @@
 test-tag.t
 test-tags.t
 test-template-filters.t
+test-transplant.t
 test-treemanifest.t
 test-ui-color.py
 test-ui-config.py
--- a/tests/test-transplant.t	Mon Jun 18 16:06:28 2018 +0530
+++ b/tests/test-transplant.t	Mon Jun 18 16:07:46 2018 +0530
@@ -836,9 +836,9 @@
   $ cd binarysource
   $ echo a > a
   $ hg ci -Am adda a
-  >>> open('b', 'wb').write(b'\0b1')
+  >>> open('b', 'wb').write(b'\0b1') and None
   $ hg ci -Am addb b
-  >>> open('b', 'wb').write(b'\0b2')
+  >>> open('b', 'wb').write(b'\0b2') and None
   $ hg ci -m changeb b
   $ cd ..