[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

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



commit ad8ac7d16263a964baec759ca4452eb21de73dd9
Author: Isis Lovecruft <isis@xxxxxxxxxxxxxx>
Date:   Mon Apr 22 00:16:20 2013 +0000

    Update docstring for SSLContextError.
---
 nettests/experimental/tls_handshake.py |   22 ++++++++++++++--------
 1 files 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
 



_______________________________________________
tor-commits mailing list
tor-commits@xxxxxxxxxxxxxxxxxxxx
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits