mirror of
https://github.com/ansible-collections/community.crypto.git
synced 2026-05-07 22:03:01 +00:00
Improve typing (#911)
* Make type checking more strict. * mypy: warn about unreachable code. * Enable warn_redundant_casts. * Enable strict_bytes. * Look at some warn_return_any warnings.
This commit is contained in:
@@ -287,7 +287,9 @@ class _Curve:
|
||||
def _get_ec_class(
|
||||
self, *, module: GeneralAnsibleModule
|
||||
) -> type[cryptography.hazmat.primitives.asymmetric.ec.EllipticCurve]:
|
||||
ecclass = cryptography.hazmat.primitives.asymmetric.ec.__dict__.get(self.ectype) # type: ignore
|
||||
ecclass: (
|
||||
type[cryptography.hazmat.primitives.asymmetric.ec.EllipticCurve] | None
|
||||
) = cryptography.hazmat.primitives.asymmetric.ec.__dict__.get(self.ectype)
|
||||
if ecclass is None:
|
||||
module.fail_json(
|
||||
msg=f"Your cryptography version does not support {self.ectype}"
|
||||
|
||||
Reference in New Issue
Block a user