Karl Ramm  committed 425cf5d

Leftover errnos were causing error misinterpretation

  • Participants
  • Parent commits 383f13f
  • Branches py3k

Comments (0)

Files changed (1)

File pypy/module/_ssl/

 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
             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()
         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: