From afb9c0140fd6949ede64cc1a304e9349772fca04 Mon Sep 17 00:00:00 2001 From: Dave Reisner Date: Sun, 19 Aug 2018 21:12:33 -0400 Subject: Port pactest to python3 Use BytesIO instead of StringIO, and ensure that we unicode-encode data where needed. --- test/pacman/pactest.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'test/pacman/pactest.py') diff --git a/test/pacman/pactest.py b/test/pacman/pactest.py index 1f5b8483..85cce6a1 100755 --- a/test/pacman/pactest.py +++ b/test/pacman/pactest.py @@ -1,4 +1,4 @@ -#! /usr/bin/python2 +#! /usr/bin/python3 # # pactest : run automated testing on the pacman binary # @@ -45,7 +45,8 @@ def write(self, message): # duplicate stdout/stderr to a temporary file class OutputSaver(): def __init__(self): - self.save_file = tempfile.NamedTemporaryFile(prefix='pactest-output-') + self.save_file = tempfile.NamedTemporaryFile( + prefix='pactest-output-', mode='w') def __enter__(self): sys.stdout = MultiWriter(sys.stdout, self.save_file) -- cgit v1.2.3-54-g00ecf