From 179aa8ac2879ca5b9d0ea02a13d6dffda5491d3c Mon Sep 17 00:00:00 2001 From: Xavier Deguillard Date: Fri, 31 Jan 2020 15:28:49 -0800 Subject: [PATCH] tests: make test-dispatch.py python3 compatible Summary: Writing to a file opened in "b" mode needs byte strings. Reviewed By: sfilipco Differential Revision: D19668666 fbshipit-source-id: 9e8670fa080cc2a7fc611083a4ee2305d8262a3a --- eden/scm/tests/test-dispatch.py | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/eden/scm/tests/test-dispatch.py b/eden/scm/tests/test-dispatch.py index 236bd8ba04..8de0b2d76f 100644 --- a/eden/scm/tests/test-dispatch.py +++ b/eden/scm/tests/test-dispatch.py @@ -3,10 +3,6 @@ from __future__ import absolute_import, print_function import os from edenscm.mercurial import dispatch -from hghave import require - - -require(["py2"]) def testdispatch(cmd): @@ -25,14 +21,14 @@ os.chdir("test1") # create file 'foo', add and commit f = open("foo", "wb") -f.write("foo\n") +f.write(b"foo\n") f.close() testdispatch("add foo") testdispatch("commit -m commit1 -d 2000-01-01 foo") # append to file 'foo' and commit f = open("foo", "ab") -f.write("bar\n") +f.write(b"bar\n") f.close() testdispatch("commit -m commit2 -d 2000-01-02 foo")