A few more fixes after dropping Python 2 support

This commit is contained in:
Roman Zeyde
2021-06-19 21:45:54 +03:00
parent ceffe7fac0
commit 96b87ec5be
3 changed files with 4 additions and 10 deletions

View File

@@ -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)

View File

@@ -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:

View File

@@ -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',