Skip to content

Commit 5d89310

Browse files
committed
Black everything
1 parent d99e9c5 commit 5d89310

31 files changed

+993
-1076
lines changed

docs/conf.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@
8181
base_dir = os.path.join(os.path.dirname(__file__), os.pardir)
8282
about = {}
8383
with open(os.path.join(base_dir, "src", "cryptography", "__about__.py")) as f:
84-
exec (f.read(), about)
84+
exec(f.read(), about)
8585

8686
version = release = about["__version__"]
8787

src/_cffi_src/utils.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
base_src = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
1717
about = {}
1818
with open(os.path.join(base_src, "cryptography", "__about__.py")) as f:
19-
exec (f.read(), about)
19+
exec(f.read(), about)
2020

2121

2222
def build_ffi_for_binding(

src/cryptography/hazmat/backends/openssl/backend.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1165,7 +1165,7 @@ def _create_x509_extension(self, handlers, extension):
11651165
*[
11661166
encode_der(INTEGER, encode_der_integer(x.value))
11671167
for x in extension.value
1168-
]
1168+
],
11691169
)
11701170
value = _encode_asn1_str_gc(self, asn1)
11711171
return self._create_raw_x509_extension(extension, value)

src/cryptography/hazmat/backends/openssl/decode_asn1.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,7 @@ def _decode_general_name(backend, gn):
130130
if "1" in bits[prefix:]:
131131
raise ValueError("Invalid netmask")
132132

133-
ip = ipaddress.ip_network(base.exploded + u"/{}".format(prefix))
133+
ip = ipaddress.ip_network(base.exploded + "/{}".format(prefix))
134134
else:
135135
ip = ipaddress.ip_address(data)
136136

src/cryptography/hazmat/primitives/asymmetric/dh.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -86,9 +86,7 @@ def public_key(self, backend=None):
8686

8787
class DHParameterNumbers(object):
8888
def __init__(self, p, g, q=None):
89-
if not isinstance(p, int) or not isinstance(
90-
g, int
91-
):
89+
if not isinstance(p, int) or not isinstance(g, int):
9290
raise TypeError("p and g must be integers")
9391
if q is not None and not isinstance(q, int):
9492
raise TypeError("q must be integer or None")

src/cryptography/hazmat/primitives/asymmetric/ec.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,9 @@ def sign(self, data, signature_algorithm):
9595
"""
9696

9797

98-
class EllipticCurvePrivateKeyWithSerialization(EllipticCurvePrivateKey, metaclass=abc.ABCMeta):
98+
class EllipticCurvePrivateKeyWithSerialization(
99+
EllipticCurvePrivateKey, metaclass=abc.ABCMeta
100+
):
99101
@abc.abstractmethod
100102
def private_numbers(self):
101103
"""
@@ -335,9 +337,7 @@ def derive_private_key(private_value, curve, backend=None):
335337

336338
class EllipticCurvePublicNumbers(object):
337339
def __init__(self, x, y, curve):
338-
if not isinstance(x, int) or not isinstance(
339-
y, int
340-
):
340+
if not isinstance(x, int) or not isinstance(y, int):
341341
raise TypeError("x and y must be integers.")
342342

343343
if not isinstance(curve, EllipticCurve):

src/cryptography/hazmat/primitives/asymmetric/rsa.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -339,9 +339,7 @@ def __hash__(self):
339339

340340
class RSAPublicNumbers(object):
341341
def __init__(self, e, n):
342-
if not isinstance(e, int) or not isinstance(
343-
n, int
344-
):
342+
if not isinstance(e, int) or not isinstance(n, int):
345343
raise TypeError("RSAPublicNumbers arguments must be integers.")
346344

347345
self._e = e

src/cryptography/x509/extensions.py

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -668,9 +668,9 @@ def __init__(self, require_explicit_policy, inhibit_policy_mapping):
668668

669669
def __repr__(self):
670670
return (
671-
u"<PolicyConstraints(require_explicit_policy={0.require_explicit"
672-
u"_policy}, inhibit_policy_mapping={0.inhibit_policy_"
673-
u"mapping})>".format(self)
671+
"<PolicyConstraints(require_explicit_policy={0.require_explicit"
672+
"_policy}, inhibit_policy_mapping={0.inhibit_policy_"
673+
"mapping})>".format(self)
674674
)
675675

676676
def __eq__(self, other):
@@ -740,8 +740,7 @@ def __init__(self, policy_identifier, policy_qualifiers):
740740
if policy_qualifiers:
741741
policy_qualifiers = list(policy_qualifiers)
742742
if not all(
743-
isinstance(x, (str, UserNotice))
744-
for x in policy_qualifiers
743+
isinstance(x, (str, UserNotice)) for x in policy_qualifiers
745744
):
746745
raise TypeError(
747746
"policy_qualifiers must be a list of strings and/or "
@@ -1177,8 +1176,8 @@ def _validate_ip_name(self, tree):
11771176

11781177
def __repr__(self):
11791178
return (
1180-
u"<NameConstraints(permitted_subtrees={0.permitted_subtrees}, "
1181-
u"excluded_subtrees={0.excluded_subtrees})>".format(self)
1179+
"<NameConstraints(permitted_subtrees={0.permitted_subtrees}, "
1180+
"excluded_subtrees={0.excluded_subtrees})>".format(self)
11821181
)
11831182

11841183
def __hash__(self):

tests/hazmat/backends/test_openssl.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -39,17 +39,17 @@
3939

4040

4141
def skip_if_libre_ssl(openssl_version):
42-
if u"LibreSSL" in openssl_version:
42+
if "LibreSSL" in openssl_version:
4343
pytest.skip("LibreSSL hard-codes RAND_bytes to use arc4random.")
4444

4545

4646
class TestLibreSkip(object):
4747
def test_skip_no(self):
48-
assert skip_if_libre_ssl(u"OpenSSL 1.0.2h 3 May 2016") is None
48+
assert skip_if_libre_ssl("OpenSSL 1.0.2h 3 May 2016") is None
4949

5050
def test_skip_yes(self):
5151
with pytest.raises(pytest.skip.Exception):
52-
skip_if_libre_ssl(u"LibreSSL 2.1.6")
52+
skip_if_libre_ssl("LibreSSL 2.1.6")
5353

5454

5555
class DummyMGF(object):

tests/hazmat/primitives/test_chacha20.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,4 +71,4 @@ def test_invalid_nonce(self):
7171

7272
def test_invalid_key_type(self):
7373
with pytest.raises(TypeError, match="key must be bytes"):
74-
algorithms.ChaCha20(u"0" * 32, b"0" * 16)
74+
algorithms.ChaCha20("0" * 32, b"0" * 16)

0 commit comments

Comments
 (0)