[tor-commits] [ooni-probe/develop] Update docstring for SSLContextError.

isis at torproject.org isis at torproject.org
Thu Jun 6 16:41:38 UTC 2013


commit ad8ac7d16263a964baec759ca4452eb21de73dd9
Author: Isis Lovecruft <isis at torproject.org>
Date:   Mon Apr 22 00:16:20 2013 +0000

    Update docstring for SSLContextError.
---
 nettests/experimental/tls_handshake.py |   22 ++++++++++++++--------
 1 file changed, 14 insertions(+), 8 deletions(-)

diff --git a/nettests/experimental/tls_handshake.py b/nettests/experimental/tls_handshake.py
index a1e46ec..5d6d293 100644
--- a/nettests/experimental/tls_handshake.py
+++ b/nettests/experimental/tls_handshake.py
@@ -66,15 +66,21 @@ firefox_ciphers = ["ECDHE-ECDSA-AES256-SHA",
                    "DHE-DSS-CAMELLIA128-SHA",]
 
 
-class NoSSLContextError(Exception):
-    """
-    Raised when we're missing the SSL context method, which should be one of
-    the following:
+class SSLContextError(usage.UsageError):
+    """Raised when we're missing the SSL context method, or incompatible
+    contexts were provided. The SSL context method should be one of the
+    following:
+
+        :attr:`OpenSSL.SSL.SSLv2_METHOD <OpenSSL.SSL.SSLv2_METHOD>`
+        :attr:`OpenSSL.SSL.SSLv23_METHOD <OpenSSL.SSL.SSLv23_METHOD>`
+        :attr:`OpenSSL.SSL.SSLv3_METHOD <OpenSSL.SSL.SSLv3_METHOD>`
+        :attr:`OpenSSL.SSL.TLSv1_METHOD <OpenSSL.SSL.TLSv1_METHOD>`
+
+    To use the pre-defined error messages, construct with one of the
+    :meth:`SSLContextError.errors.keys <keys>` as the ``message`` string, like
+    so:
 
-        * :attr:`OpenSSL.SSL.SSLv2_METHOD`
-        * :attr:`OpenSSL.SSL.SSLv23_METHOD`
-        * :attr:`OpenSSL.SSL.SSLv3_METHOD`
-        * :attr:`OpenSSL.SSL.TLSv1_METHOD`
+        ``SSLContextError('NO_CONTEXT')``
     """
     pass
 





More information about the tor-commits mailing list