Skip to content

Commit 0488214

Browse files
authored
I'm back in black (#941)
1 parent ffab488 commit 0488214

File tree

2 files changed

+21
-9
lines changed

2 files changed

+21
-9
lines changed

src/OpenSSL/SSL.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -972,7 +972,11 @@ def set_session_id(self, buf):
972972
"""
973973
buf = _text_to_bytes_and_warn("buf", buf)
974974
_openssl_assert(
975-
_lib.SSL_CTX_set_session_id_context(self._context, buf, len(buf),)
975+
_lib.SSL_CTX_set_session_id_context(
976+
self._context,
977+
buf,
978+
len(buf),
979+
)
976980
== 1
977981
)
978982

@@ -1468,9 +1472,6 @@ def set_ocsp_client_callback(self, callback, data=None):
14681472

14691473

14701474
class Connection(object):
1471-
"""
1472-
"""
1473-
14741475
_reverse_mapping = WeakValueDictionary()
14751476

14761477
def __init__(self, context, socket=None):

tests/test_ssl.py

Lines changed: 16 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -448,7 +448,8 @@ def ca_file(tmpdir):
448448
builder = builder.serial_number(int(uuid.uuid4()))
449449
builder = builder.public_key(public_key)
450450
builder = builder.add_extension(
451-
x509.BasicConstraints(ca=True, path_length=None), critical=True,
451+
x509.BasicConstraints(ca=True, path_length=None),
452+
critical=True,
452453
)
453454

454455
certificate = builder.sign(
@@ -457,7 +458,9 @@ def ca_file(tmpdir):
457458

458459
ca_file = tmpdir.join("test.pem")
459460
ca_file.write_binary(
460-
certificate.public_bytes(encoding=serialization.Encoding.PEM,)
461+
certificate.public_bytes(
462+
encoding=serialization.Encoding.PEM,
463+
)
461464
)
462465

463466
return str(ca_file).encode("ascii")
@@ -509,7 +512,13 @@ def test_set_cipher_list_no_cipher_match(self, context):
509512
with pytest.raises(Error) as excinfo:
510513
context.set_cipher_list(b"imaginary-cipher")
511514
assert excinfo.value.args == (
512-
[("SSL routines", "SSL_CTX_set_cipher_list", "no cipher match",)],
515+
[
516+
(
517+
"SSL routines",
518+
"SSL_CTX_set_cipher_list",
519+
"no cipher match",
520+
)
521+
],
513522
)
514523

515524
def test_load_client_ca(self, context, ca_file):
@@ -644,7 +653,8 @@ def test_use_privatekey_file_bytes(self, tmpfile):
644653
instance giving the file name to ``Context.use_privatekey_file``.
645654
"""
646655
self._use_privatekey_file_test(
647-
tmpfile + NON_ASCII.encode(getfilesystemencoding()), FILETYPE_PEM,
656+
tmpfile + NON_ASCII.encode(getfilesystemencoding()),
657+
FILETYPE_PEM,
648658
)
649659

650660
def test_use_privatekey_file_unicode(self, tmpfile):
@@ -653,7 +663,8 @@ def test_use_privatekey_file_unicode(self, tmpfile):
653663
instance giving the file name to ``Context.use_privatekey_file``.
654664
"""
655665
self._use_privatekey_file_test(
656-
tmpfile.decode(getfilesystemencoding()) + NON_ASCII, FILETYPE_PEM,
666+
tmpfile.decode(getfilesystemencoding()) + NON_ASCII,
667+
FILETYPE_PEM,
657668
)
658669

659670
def test_use_certificate_wrong_args(self):

0 commit comments

Comments
 (0)