py3: make tests/test-log-linerange.t work on Python 3
authorPulkit Goyal <7895pulkit@gmail.com>
Mon, 19 Mar 2018 00:02:59 +0530
changeset 36997 0baf0e3ee569
parent 36996 f4c7dc24e889
child 36998 d5d42c170f4d
py3: make tests/test-log-linerange.t work on Python 3 Made sure we write bytes to file and we suppress the return value of open(). Differential Revision: https://phab.mercurial-scm.org/D2893
tests/test-log-linerange.t
--- a/tests/test-log-linerange.t	Mon Mar 19 00:04:38 2018 +0530
+++ b/tests/test-log-linerange.t	Mon Mar 19 00:02:59 2018 +0530
@@ -871,7 +871,7 @@
 Binary files work but without diff hunks filtering.
 (Checking w/ and w/o diff.git option.)
 
-  >>> open('binary', 'wb').write('this\nis\na\nbinary\0')
+  >>> open('binary', 'wb').write(b'this\nis\na\nbinary\0') and None
   $ hg add binary
   $ hg ci -m 'add a binary file' --quiet
   $ hg log -f -L binary,1:2 -p