[pypy-commit] pypy default: small optimization

arigo pypy.commits at gmail.com
Sat Jan 28 05:10:37 EST 2017


Author: Armin Rigo <arigo at tunes.org>
Branch: 
Changeset: r89817:76e31bc8fefd
Date: 2017-01-28 11:09 +0100
http://bitbucket.org/pypy/pypy/changeset/76e31bc8fefd/

Log:	small optimization

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
@@ -1243,6 +1243,9 @@
     struct = SERVERNAME_CALLBACKS.get(rffi.cast(lltype.Signed, arg))
     w_ctx = struct.w_ctx
     space = struct.space
+    # annotation: ensures that we ignore the case 'space is None'
+    # (it would propagate to a few methods like errorstr())
+    assert w_ctx is not None and space is not None
     w_callback = struct.w_set_hostname
     if not w_ctx.servername_callback:
         # Possible race condition.


More information about the pypy-commit mailing list