Skip to content

Commit

Permalink
fix bad use of type and fix with modern ruff (#15)
Browse files Browse the repository at this point in the history
  • Loading branch information
jschlyter authored Oct 10, 2024
1 parent 5a59f52 commit 5a9b1c5
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
SHELL=/bin/bash

lint:
ruff http_message_signatures
ruff check http_message_signatures
mypy --check-untyped-defs http_message_signatures

test: lint
Expand Down
4 changes: 2 additions & 2 deletions http_message_signatures/_algorithms.py
Original file line number Diff line number Diff line change
Expand Up @@ -91,9 +91,9 @@ def __init__(self, public_key=None, private_key=None, password=None):
raise HTTPMessageSignaturesException("Unexpected public key type")
if self.private_key and not isinstance(self.private_key, ec.EllipticCurvePrivateKey):
raise HTTPMessageSignaturesException("Unexpected private key type")
if self.public_key and type(self.public_key.curve) != ec.SECP256R1:
if self.public_key and not isinstance(self.public_key.curve, ec.SECP256R1):
raise HTTPMessageSignaturesException("Unexpected elliptic curve type in public key")
if self.private_key and type(self.private_key.curve) != ec.SECP256R1:
if self.private_key and not isinstance(self.private_key.curve, ec.SECP256R1):
raise HTTPMessageSignaturesException("Unexpected elliptic curve type in private key")
self.signature_algorithm = ec.ECDSA(hashes.SHA256())

Expand Down

0 comments on commit 5a9b1c5

Please sign in to comment.