diff --git a/lang/python/tests/support.py b/lang/python/tests/support.py index f991c6d1..0b04bb6f 100644 --- a/lang/python/tests/support.py +++ b/lang/python/tests/support.py @@ -48,7 +48,11 @@ def print_data(data): except: # Hope for the best. pass - sys.stdout.buffer.write(data) + + if hasattr(sys.stdout, "buffer"): + sys.stdout.buffer.write(data) + else: + sys.stdout.write(data) def mark_key_trusted(ctx, key): class Editor(object):