summaryrefslogtreecommitdiff
path: root/test/pacman/pactest.py
diff options
context:
space:
mode:
authorDave Reisner <dreisner@archlinux.org>2018-08-19 21:12:33 -0400
committerAndrew Gregory <andrew.gregory.8@gmail.com>2018-10-18 18:05:19 -0700
commitafb9c0140fd6949ede64cc1a304e9349772fca04 (patch)
tree6995c7eb8f090f5af64ae6219f872b42db2eb9d3 /test/pacman/pactest.py
parentffde85aadfe0e08fb710102d0a547335e9d1a200 (diff)
downloadpacman-afb9c0140fd6949ede64cc1a304e9349772fca04.tar.xz
Port pactest to python3
Use BytesIO instead of StringIO, and ensure that we unicode-encode data where needed.
Diffstat (limited to 'test/pacman/pactest.py')
-rwxr-xr-xtest/pacman/pactest.py5
1 files changed, 3 insertions, 2 deletions
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 @@ class MultiWriter():
# 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)