Add some missing type documentation and remove an unused import.
diff --git a/OpenSSL/SSL.py b/OpenSSL/SSL.py
index 18549eb..1215526 100644
--- a/OpenSSL/SSL.py
+++ b/OpenSSL/SSL.py
@@ -704,7 +704,9 @@
"""
Load parameters for Ephemeral Diffie-Hellman
- :param dhfile: The file to load EDH parameters from
+ :param dhfile: The file to load EDH parameters from (``bytes`` or
+ ``unicode``).
+
:return: None
"""
dhfile = _path_string(dhfile)
diff --git a/OpenSSL/rand.py b/OpenSSL/rand.py
index 7592fe0..3adf693 100644
--- a/OpenSSL/rand.py
+++ b/OpenSSL/rand.py
@@ -132,9 +132,10 @@
"""
Seed the PRNG with data from a file
- :param filename: The file to read data from
- :param maxbytes: (optional) The number of bytes to read, default is
- to read the entire file
+ :param filename: The file to read data from (``bytes`` or ``unicode``).
+ :param maxbytes: (optional) The number of bytes to read, default is to read
+ the entire file
+
:return: The number of bytes read
"""
filename = _path_string(filename)
@@ -152,7 +153,8 @@
"""
Save PRNG state to a file
- :param filename: The file to write data to
+ :param filename: The file to write data to (``bytes`` or ``unicode``).
+
:return: The number of bytes written
"""
filename = _path_string(filename)
diff --git a/OpenSSL/test/test_ssl.py b/OpenSSL/test/test_ssl.py
index a2dfb8a..c82dea6 100644
--- a/OpenSSL/test/test_ssl.py
+++ b/OpenSSL/test/test_ssl.py
@@ -14,7 +14,7 @@
from unittest import main
from weakref import ref
-from six import PY3, binary_type, text_type, u
+from six import PY3, text_type, u
from OpenSSL.crypto import TYPE_RSA, FILETYPE_PEM
from OpenSSL.crypto import PKey, X509, X509Extension, X509Store
@@ -1375,6 +1375,10 @@
def _load_tmp_dh_test(self, dhfilename):
+ """
+ Verify that calling ``Context.load_tmp_dh`` with the given filename
+ does not raise an exception.
+ """
context = Context(TLSv1_METHOD)
with open(dhfilename, "w") as dhfile:
dhfile.write(dhparam)