[pypy-commit] pypy py3k: python3 ssl constructor actually raises ValueError on illegal protocol

Karl Ramm noreply at buildbot.pypy.org
Mon Mar 18 08:44:08 CET 2013


Author: Karl Ramm <kcr at 1ts.org>
Branch: py3k
Changeset: r62396:979b3dd2b1a5
Date: 2013-03-18 01:51 -0400
http://bitbucket.org/pypy/pypy/changeset/979b3dd2b1a5/

Log:	python3 ssl constructor actually raises ValueError on illegal
	protocol

diff --git a/pypy/module/_ssl/interp_ssl.py b/pypy/module/_ssl/interp_ssl.py
--- a/pypy/module/_ssl/interp_ssl.py
+++ b/pypy/module/_ssl/interp_ssl.py
@@ -116,7 +116,8 @@
         elif protocol == PY_SSL_VERSION_SSL23:
             method = libssl_SSLv23_method()
         else:
-            raise ssl_error(space, "invalid SSL protocol version")
+            raise OperationError(
+                space.w_ValueError, space.wrap("invalid protocol version"))
         self.__init__(method)
         if not self.ctx:
             raise ssl_error(space, "failed to allocate SSL context")


More information about the pypy-commit mailing list