fix new pylint warning
This commit is contained in:
@@ -21,11 +21,10 @@ def _message_box(label, sp=subprocess):
|
||||
p = sp.Popen(args=args, stdin=sp.PIPE, stdout=sp.PIPE, stderr=sp.PIPE)
|
||||
out, err = p.communicate(label.encode('ascii'))
|
||||
exitcode = p.wait()
|
||||
if exitcode == 0:
|
||||
return out.decode('ascii')
|
||||
else:
|
||||
if exitcode != 0:
|
||||
log.error('UI failed: %r', err)
|
||||
raise sp.CalledProcessError(exitcode, args)
|
||||
return out.decode('ascii')
|
||||
|
||||
|
||||
def _is_open_tty(stream):
|
||||
|
||||
@@ -102,6 +102,8 @@ def _decompress_ed25519(pubkey):
|
||||
if pubkey[:1] == b'\x00':
|
||||
# set by Trezor fsm_msgSignIdentity() and fsm_msgGetPublicKey()
|
||||
return ed25519.VerifyingKey(pubkey[1:])
|
||||
else:
|
||||
return None
|
||||
|
||||
|
||||
def _decompress_nist256(pubkey):
|
||||
@@ -126,6 +128,8 @@ def _decompress_nist256(pubkey):
|
||||
point = ecdsa.ellipticcurve.Point(curve.curve, x, y)
|
||||
return ecdsa.VerifyingKey.from_public_point(point, curve=curve,
|
||||
hashfunc=hashfunc)
|
||||
else:
|
||||
return None
|
||||
|
||||
|
||||
def decompress_pubkey(pubkey, curve_name):
|
||||
|
||||
@@ -228,3 +228,4 @@ def main(device_type):
|
||||
else:
|
||||
for pk in conn.public_keys():
|
||||
sys.stdout.write(pk)
|
||||
return 0 # success exit code
|
||||
|
||||
@@ -79,9 +79,9 @@ def test_server_thread():
|
||||
|
||||
class FakeServer(object):
|
||||
def accept(self): # pylint: disable=no-self-use
|
||||
if connections:
|
||||
return connections.pop(), 'address'
|
||||
raise socket.timeout()
|
||||
if not connections:
|
||||
raise socket.timeout()
|
||||
return connections.pop(), 'address'
|
||||
|
||||
def getsockname(self): # pylint: disable=no-self-use
|
||||
return 'fake_server'
|
||||
|
||||
Reference in New Issue
Block a user