diff --git a/amodem/__main__.py b/amodem/__main__.py index 352c4ab..8a9a717 100644 --- a/amodem/__main__.py +++ b/amodem/__main__.py @@ -15,11 +15,6 @@ from . import main from .config import bitrates -# Python 3 has `buffer` attribute for byte-based I/O -_stdin = getattr(sys.stdin, 'buffer', sys.stdin) -_stdout = getattr(sys.stdout, 'buffer', sys.stdout) - - try: import argcomplete except ImportError: @@ -83,9 +78,9 @@ def FileType(mode, interface_factory=None): if fname == '-': if 'r' in mode: - return _stdin + return sys.stdin.buffer if 'w' in mode: - return _stdout + return sys.stdout.buffer return open(fname, mode) diff --git a/amodem/framing.py b/amodem/framing.py index f510532..946e4b9 100644 --- a/amodem/framing.py +++ b/amodem/framing.py @@ -10,8 +10,7 @@ log = logging.getLogger(__name__) def _checksum_func(x): - ''' The result will be unsigned on Python 2/3. ''' - return binascii.crc32(bytes(x)) & 0xFFFFFFFF + return binascii.crc32(bytes(x)) class Checksum: diff --git a/setup.py b/setup.py index 49ef2f9..d071558 100644 --- a/setup.py +++ b/setup.py @@ -32,10 +32,10 @@ setup( 'Intended Audience :: Information Technology', 'License :: OSI Approved :: MIT License', 'Operating System :: POSIX', - 'Programming Language :: Python :: 3.5', 'Programming Language :: Python :: 3.6', 'Programming Language :: Python :: 3.7', 'Programming Language :: Python :: 3.8', + 'Programming Language :: Python :: 3.9', 'Topic :: Software Development :: Libraries :: Python Modules', 'Topic :: System :: Networking', 'Topic :: Communications',