py3: make sure we open the file in bytes mode
authorPulkit Goyal <7895pulkit@gmail.com>
Wed, 28 Feb 2018 22:03:47 +0530
changeset 36483 5a029f049854
parent 36482 14d2371216ba
child 36484 71d1bbf1617e
py3: make sure we open the file in bytes mode This makes the test pass on Python 3. Differential Revision: https://phab.mercurial-scm.org/D2507
tests/test-revlog-ancestry.py
--- a/tests/test-revlog-ancestry.py	Wed Feb 28 22:03:29 2018 +0530
+++ b/tests/test-revlog-ancestry.py	Wed Feb 28 22:03:47 2018 +0530
@@ -15,7 +15,7 @@
     repo.commit(text=text, date=b"%d 0" % time)
 
 def addcommit(name, time):
-    f = open(name, 'w')
+    f = open(name, 'wb')
     f.write(b'%s\n' % name)
     f.close()
     repo[None].add([name])