Author: Karl Ramm <[email protected]>
Branch: py3k
Changeset: r62426:425cf5d5e4b5
Date: 2013-03-18 17:26 -0400
http://bitbucket.org/pypy/pypy/changeset/425cf5d5e4b5/
Log: Leftover errnos were causing error misinterpretation
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
@@ -8,7 +8,7 @@
from rpython.rlib.rarithmetic import intmask
from rpython.rlib import rpoll, rsocket
from rpython.rlib.ropenssl import *
-from rpython.rlib.rposix import get_errno
+from rpython.rlib.rposix import get_errno, set_errno
from pypy.module._socket import interp_socket
import weakref
@@ -185,6 +185,8 @@
else:
keyfile = space.str_w(w_keyfile)
+ set_errno(0)
+
ret = libssl_SSL_CTX_use_certificate_chain_file(self.ctx, certfile)
if ret != 1:
errno = get_errno()
@@ -222,6 +224,7 @@
if cafile is None and capath is None:
raise OperationError(space.w_TypeError, space.wrap(
"cafile and capath cannot be both omitted"))
+ set_errno(0)
ret = libssl_SSL_CTX_load_verify_locations(
self.ctx, cafile, capath)
if ret != 1:
_______________________________________________
pypy-commit mailing list
[email protected]
http://mail.python.org/mailman/listinfo/pypy-commit