Patchwork D3793: py3: add `and None` to suppress return values of .write() calls

login
register
mail settings
Submitter phabricator
Date June 18, 2018, 10:39 a.m.
Message ID <differential-rev-PHID-DREV-yitz4zqmwjhhszlmacmc-req@phab.mercurial-scm.org>
Download mbox | patch
Permalink /patch/32254/
State Superseded
Headers show

Comments

phabricator - June 18, 2018, 10:39 a.m.
pulkit created this revision.
Herald added a subscriber: mercurial-devel.
Herald added a reviewer: hg-reviewers.

REVISION SUMMARY
  .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.

REPOSITORY
  rHG Mercurial

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

AFFECTED FILES
  contrib/python3-whitelist
  tests/test-transplant.t

CHANGE DETAILS




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

Patch

diff --git a/tests/test-transplant.t b/tests/test-transplant.t
--- a/tests/test-transplant.t
+++ b/tests/test-transplant.t
@@ -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 ..
 
diff --git a/contrib/python3-whitelist b/contrib/python3-whitelist
--- a/contrib/python3-whitelist
+++ b/contrib/python3-whitelist
@@ -492,6 +492,7 @@ 
 test-tags.t
 test-template-engine.t
 test-template-filters.t
+test-transplant.t
 test-treemanifest.t
 test-ui-color.py
 test-ui-config.py