a random set of flake8 and typo fixes
diff --git a/OpenSSL/SSL.py b/OpenSSL/SSL.py
index b83f4b8..ef37fd2 100644
--- a/OpenSSL/SSL.py
+++ b/OpenSSL/SSL.py
@@ -291,9 +291,9 @@
protolist = []
while instr:
l = indexbytes(instr, 0)
- proto = instr[1:l+1]
+ proto = instr[1:l + 1]
protolist.append(proto)
- instr = instr[l+1:]
+ instr = instr[l + 1:]
# Call the callback
outstr = callback(conn, protolist)
diff --git a/OpenSSL/_util.py b/OpenSSL/_util.py
index 0cc34d8..b3ea8f7 100644
--- a/OpenSSL/_util.py
+++ b/OpenSSL/_util.py
@@ -41,9 +41,9 @@
if error == 0:
break
errors.append((
- text(lib.ERR_lib_error_string(error)),
- text(lib.ERR_func_error_string(error)),
- text(lib.ERR_reason_error_string(error))))
+ text(lib.ERR_lib_error_string(error)),
+ text(lib.ERR_func_error_string(error)),
+ text(lib.ERR_reason_error_string(error))))
raise exception_type(errors)
@@ -104,6 +104,7 @@
text_type.__name__ + " for {0} is no longer accepted, use bytes"
)
+
def text_to_bytes_and_warn(label, obj):
"""
If ``obj`` is text, emit a warning that it should be bytes instead and try
diff --git a/OpenSSL/crypto.py b/OpenSSL/crypto.py
index a52862c..446f7f8 100644
--- a/OpenSSL/crypto.py
+++ b/OpenSSL/crypto.py
@@ -1578,7 +1578,7 @@
Convert an OpenSSL native context error failure into a Python
exception.
- When a call to native OpenSSL X509_verify_cert fails, additonal information
+ When a call to native OpenSSL X509_verify_cert fails, additional information
about the failure can be obtained from the store context.
"""
errors = [
@@ -1616,7 +1616,7 @@
:param store_ctx: The :py:class:`X509StoreContext` to verify.
- :raises X509StoreContextError: If an error occured when validating a
+ :raises X509StoreContextError: If an error occurred when validating a
certificate in the context. Sets ``certificate`` attribute to indicate
which certificate caused the error.
"""
@@ -1784,7 +1784,7 @@
b"cessationOfOperation",
b"certificateHold",
# b"removeFromCRL",
- ]
+ ]
def __init__(self):
revoked = _lib.X509_REVOKED_new()
diff --git a/OpenSSL/rand.py b/OpenSSL/rand.py
index 3adf693..27d9f7e 100644
--- a/OpenSSL/rand.py
+++ b/OpenSSL/rand.py
@@ -26,6 +26,7 @@
_builtin_bytes = bytes
+
def bytes(num_bytes):
"""
Get some random bytes as a string.
diff --git a/OpenSSL/test/test_crypto.py b/OpenSSL/test/test_crypto.py
index 2f5ccad..5b8ab77 100644
--- a/OpenSSL/test/test_crypto.py
+++ b/OpenSSL/test/test_crypto.py
@@ -3222,7 +3222,7 @@
def test_export_unknown_digest(self):
"""
- Calling :py:obj:`OpenSSL.CRL.export` with a unsupported digest results
+ Calling :py:obj:`OpenSSL.CRL.export` with an unsupported digest results
in a :py:obj:`ValueError` being raised.
"""
crl = CRL()
diff --git a/OpenSSL/tsafe.py b/OpenSSL/tsafe.py
index 3a9c710..28df8cb 100644
--- a/OpenSSL/tsafe.py
+++ b/OpenSSL/tsafe.py
@@ -25,4 +25,3 @@
return self._ssl_conn.%s(*args)
finally:
self._lock.release()\n""" % (f, f))
-