Skip to content

Commit

Permalink
Black everything
Browse files Browse the repository at this point in the history
  • Loading branch information
alex committed Dec 9, 2020
1 parent cd86457 commit 5ab1eb1
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 12 deletions.
4 changes: 1 addition & 3 deletions src/cryptography/hazmat/primitives/asymmetric/dh.py
Original file line number Diff line number Diff line change
Expand Up @@ -85,9 +85,7 @@ def public_key(self, backend=None):

class DHParameterNumbers(object):
def __init__(self, p, g, q=None):
if not isinstance(p, int) or not isinstance(
g, int
):
if not isinstance(p, int) or not isinstance(g, int):
raise TypeError("p and g must be integers")
if q is not None and not isinstance(q, int):
raise TypeError("q must be integer or None")
Expand Down
8 changes: 4 additions & 4 deletions src/cryptography/hazmat/primitives/asymmetric/ec.py
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,9 @@ def sign(self, data, signature_algorithm):
"""


class EllipticCurvePrivateKeyWithSerialization(EllipticCurvePrivateKey, metaclass=abc.ABCMeta):
class EllipticCurvePrivateKeyWithSerialization(
EllipticCurvePrivateKey, metaclass=abc.ABCMeta
):
@abc.abstractmethod
def private_numbers(self):
"""
Expand Down Expand Up @@ -334,9 +336,7 @@ def derive_private_key(private_value, curve, backend=None):

class EllipticCurvePublicNumbers(object):
def __init__(self, x, y, curve):
if not isinstance(x, int) or not isinstance(
y, int
):
if not isinstance(x, int) or not isinstance(y, int):
raise TypeError("x and y must be integers.")

if not isinstance(curve, EllipticCurve):
Expand Down
4 changes: 1 addition & 3 deletions src/cryptography/hazmat/primitives/asymmetric/rsa.py
Original file line number Diff line number Diff line change
Expand Up @@ -338,9 +338,7 @@ def __hash__(self):

class RSAPublicNumbers(object):
def __init__(self, e, n):
if not isinstance(e, int) or not isinstance(
n, int
):
if not isinstance(e, int) or not isinstance(n, int):
raise TypeError("RSAPublicNumbers arguments must be integers.")

self._e = e
Expand Down
3 changes: 1 addition & 2 deletions src/cryptography/x509/extensions.py
Original file line number Diff line number Diff line change
Expand Up @@ -739,8 +739,7 @@ def __init__(self, policy_identifier, policy_qualifiers):
if policy_qualifiers:
policy_qualifiers = list(policy_qualifiers)
if not all(
isinstance(x, (str, UserNotice))
for x in policy_qualifiers
isinstance(x, (str, UserNotice)) for x in policy_qualifiers
):
raise TypeError(
"policy_qualifiers must be a list of strings and/or "
Expand Down

0 comments on commit 5ab1eb1

Please sign in to comment.