Fix pylint warnings

This commit is contained in:
Roman Zeyde
2019-09-26 08:55:10 +03:00
parent b75cf74976
commit ab6892f42f
4 changed files with 4 additions and 7 deletions

View File

@@ -1,5 +1,5 @@
[MESSAGES CONTROL] [MESSAGES CONTROL]
disable=invalid-name, missing-docstring, locally-disabled, unbalanced-tuple-unpacking,no-else-return,fixme,duplicate-code,cyclic-import disable=invalid-name, missing-docstring, locally-disabled, unbalanced-tuple-unpacking,no-else-return,fixme,duplicate-code,cyclic-import,import-outside-toplevel
[SIMILARITIES] [SIMILARITIES]
min-similarity-lines=5 min-similarity-lines=5

View File

@@ -173,9 +173,7 @@ def sign_digest(sock, keygrip, digest, sp=subprocess, environ=None):
assert communicate(sock, 'PKSIGN') == b'OK' assert communicate(sock, 'PKSIGN') == b'OK'
while True: while True:
line = recvline(sock).strip() line = recvline(sock).strip()
if line.startswith(b'S PROGRESS'): if not line.startswith(b'S PROGRESS'):
continue
else:
break break
line = unescape(line) line = unescape(line)
log.debug('unescaped: %r', line) log.debug('unescaped: %r', line)

View File

@@ -78,8 +78,7 @@ def create_agent_parser(device_type):
p.add_argument('--version', help='print the version info', p.add_argument('--version', help='print the version info',
action='version', version=versions) action='version', version=versions)
curve_names = [name for name in formats.SUPPORTED_CURVES] curve_names = ', '.join(sorted(formats.SUPPORTED_CURVES))
curve_names = ', '.join(sorted(curve_names))
p.add_argument('-e', '--ecdsa-curve-name', metavar='CURVE', p.add_argument('-e', '--ecdsa-curve-name', metavar='CURVE',
default=formats.CURVE_NIST256, default=formats.CURVE_NIST256,
help='specify ECDSA curve name: ' + curve_names) help='specify ECDSA curve name: ' + curve_names)

View File

@@ -242,7 +242,7 @@ def which(cmd):
from shutil import which as _which from shutil import which as _which
except ImportError: except ImportError:
# For Python 2 # For Python 2
from backports.shutil_which import which as _which # pylint: disable=relative-import from backports.shutil_which import which as _which
full_path = _which(cmd) full_path = _which(cmd)
if full_path is None: if full_path is None:
raise OSError('Cannot find {!r} in $PATH'.format(cmd)) raise OSError('Cannot find {!r} in $PATH'.format(cmd))