Author: Amaury Forgeot d'Arc <amaur...@gmail.com>
Branch: py3.5
Changeset: r87306:827ca1cc3dfb
Date: 2016-09-22 09:56 +0200
http://bitbucket.org/pypy/pypy/changeset/827ca1cc3dfb/

Log:    Fix translation

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
@@ -314,6 +314,7 @@
     def __init__(self, space, w_ctx):
         self.w_ctx = w_ctx
         self.w_socket = None
+        self.w_owner = None
         self.ssl = lltype.nullptr(SSL.TO)
         self.peer_cert = lltype.nullptr(X509.TO)
         self.shutdown_seen_zero = False
@@ -693,13 +694,14 @@
         libssl_SSL_set_SSL_CTX(self.ssl, ctx.ctx)
 
     def descr_get_owner(self, space):
-        if self.w_owner:
+        if self.w_owner is not None:
             w_owner = self.w_owner()
             if w_owner:
                 return w_owner
         return space.w_None
 
     def descr_set_owner(self, space, w_owner):
+        assert w_owner is not None
         self.w_owner = weakref.ref(w_owner)
 
 
@@ -1282,9 +1284,9 @@
     # SSLObject) that will be passed. Otherwise if there's a socket then that
     # will be passed. If both do not exist only then the C-level object is
     # passed.
-    if w_ssl.w_owner:
+    if w_ssl.w_owner is not None:
         w_ssl_socket = w_ssl.w_owner()
-    elif w_ssl.w_socket:
+    elif w_ssl.w_socket is not None:
         w_ssl_socket = w_ssl.w_socket()
     else:
         w_ssl_socket = w_ssl
_______________________________________________
pypy-commit mailing list
pypy-commit@python.org
https://mail.python.org/mailman/listinfo/pypy-commit

Reply via email to