From ded036cf988b0cf4b20002d88434282f30762638 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sybren=20A=2E=20St=C3=BCvel?= Date: Sun, 4 Aug 2019 15:02:20 +0200 Subject: Removed compatibility code for Python 2.7 and 3.4 --- tests/test_cli.py | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) (limited to 'tests/test_cli.py') diff --git a/tests/test_cli.py b/tests/test_cli.py index 7ce57eb..7cf7ed4 100644 --- a/tests/test_cli.py +++ b/tests/test_cli.py @@ -15,21 +15,15 @@ from io import StringIO, BytesIO import rsa import rsa.cli import rsa.util -from rsa._compat import PY2 -def make_buffer(): - if PY2: - return BytesIO() +def make_buffer() -> StringIO: buf = StringIO() buf.buffer = BytesIO() return buf -def get_bytes_out(out): - if PY2: - # Python 2.x writes 'str' to stdout - return out.getvalue() +def get_bytes_out(out: StringIO) -> bytes: # Python 3.x writes 'bytes' to stdout.buffer return out.buffer.getvalue() -- cgit v1.2.1