[pypy-commit] pypy stdlib-2.7.9: fix construction of ssl exceptions without errno

bdkearns noreply at buildbot.pypy.org
Sun Dec 21 17:16:17 CET 2014


Author: Brian Kearns <bdkearns at gmail.com>
Branch: stdlib-2.7.9
Changeset: r75051:21765b094705
Date: 2014-12-21 11:16 -0500
http://bitbucket.org/pypy/pypy/changeset/21765b094705/

Log:	fix construction of ssl exceptions without errno

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
@@ -86,8 +86,11 @@
 
 def ssl_error(space, msg, errno=0, exc='w_sslerror'):
     w_exception_class = get_exception_class(space, exc)
-    w_exception = space.call_function(w_exception_class,
-                                      space.wrap(errno), space.wrap(msg))
+    if not errno:
+        w_exception = space.call_function(w_exception_class, space.wrap(msg))
+    else:
+        w_exception = space.call_function(w_exception_class,
+                                          space.wrap(errno), space.wrap(msg))
     return OperationError(w_exception_class, w_exception)
 
 if HAVE_OPENSSL_RAND:


More information about the pypy-commit mailing list