# HG changeset patch # User timeless # Date 2016-05-06 19:19:12 # Node ID 6c0b1d964537ab62d76c208f5f04ab414814c94e # Parent ce1c6ab158075edc17db94fe4a784c86a3ed130d tests: test-archive.t use sys.stdout.buffer for binary output in py3 diff --git a/tests/test-archive.t b/tests/test-archive.t --- a/tests/test-archive.t +++ b/tests/test-archive.t @@ -86,9 +86,13 @@ invalid arch type should give 404 > node, archive, file = sys.argv[1:] > requeststr = 'cmd=archive;node=%s;type=%s;file=%s' % (node, archive, file) > try: + > stdout = sys.stdout.buffer + > except AttributeError: + > stdout = sys.stdout + > try: > f = urllib2.urlopen('http://127.0.0.1:%s/?%s' > % (os.environ['HGPORT'], requeststr)) - > sys.stdout.write(f.read()) + > stdout.write(f.read()) > except urllib2.HTTPError, e: > sys.stderr.write(str(e) + '\n') > EOF