mirror of
https://github.com/romanz/amodem.git
synced 2026-03-17 07:05:59 +08:00
A few more fixes after dropping Python 2 support
This commit is contained in:
@@ -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)
|
||||
|
||||
|
||||
@@ -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:
|
||||
|
||||
2
setup.py
2
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',
|
||||
|
||||
Reference in New Issue
Block a user