diff --git a/qubesmgmt/tests/tools/__init__.py b/qubesmgmt/tests/tools/__init__.py index ca40d33..464a5e5 100644 --- a/qubesmgmt/tests/tools/__init__.py +++ b/qubesmgmt/tests/tools/__init__.py @@ -22,9 +22,13 @@ import io import sys + class StdoutBuffer(object): def __init__(self): - self.stdout = io.StringIO() + if sys.version_info[0] >= 3: + self.stdout = io.StringIO() + else: + self.stdout = io.BytesIO() def __enter__(self): sys.stdout = self.stdout