Skip to content

Commit 9f65250

Browse files
committed
keys.py: fix flakes
1 parent 2a58dda commit 9f65250

File tree

1 file changed

+7
-8
lines changed

1 file changed

+7
-8
lines changed

src/ecdsa/keys.py

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,7 @@ def __repr__(self):
142142

143143
def __eq__(self, other):
144144
"""Return True if the points are identical, False otherwise."""
145-
if isinstance(other, VerifyingKey):
145+
if isinstance(other, VerifyingKey):
146146
return self.curve == other.curve \
147147
and self.pubkey == other.pubkey
148148
return NotImplemented
@@ -245,9 +245,9 @@ def _from_hybrid(cls, string, curve, validate_point):
245245
point = cls._from_raw_encoding(string[1:], curve)
246246

247247
# but validate if it's self-consistent if we're asked to do that
248-
if validate_point and \
249-
(point.y() & 1 and string[:1] != b('\x07') or
250-
(not point.y() & 1) and string[:1] != b('\x06')):
248+
if validate_point \
249+
and (point.y() & 1 and string[:1] != b('\x07')
250+
or (not point.y() & 1) and string[:1] != b('\x06')):
251251
raise MalformedPointError("Inconsistent hybrid point encoding")
252252

253253
return point
@@ -677,10 +677,10 @@ def __init__(self, _error__please_use_generate=None):
677677
self.baselen = None
678678
self.verifying_key = None
679679
self.privkey = None
680-
680+
681681
def __eq__(self, other):
682682
"""Return True if the points are identical, False otherwise."""
683-
if isinstance(other, SigningKey):
683+
if isinstance(other, SigningKey):
684684
return self.curve == other.curve \
685685
and self.verifying_key == other.verifying_key \
686686
and self.privkey == other.privkey
@@ -967,8 +967,7 @@ def to_der(self, point_encoding="uncompressed"):
967967
der.encode_integer(1),
968968
der.encode_octet_string(self.to_string()),
969969
der.encode_constructed(0, self.curve.encoded_oid),
970-
der.encode_constructed(1, der.encode_bitstring(encoded_vk, 0)),
971-
)
970+
der.encode_constructed(1, der.encode_bitstring(encoded_vk, 0)))
972971

973972
def get_verifying_key(self):
974973
"""

0 commit comments

Comments
 (0)