Commit 55991da7 authored by Carson Ip's avatar Carson Ip Committed by Jason Madden

Use slots for SSLContext for Python 2.7.9+

Memory usage of SSLContext goes down from 416B to 128B after patching.

Fixes #1654
parent 48bee29f
...@@ -74,6 +74,9 @@ class _fileobject(getattr(__ssl__, '_fileobject', object)): # pylint:disable=no- ...@@ -74,6 +74,9 @@ class _fileobject(getattr(__ssl__, '_fileobject', object)): # pylint:disable=no-
orig_SSLContext = __ssl__.SSLContext # pylint: disable=no-member orig_SSLContext = __ssl__.SSLContext # pylint: disable=no-member
class SSLContext(orig_SSLContext): class SSLContext(orig_SSLContext):
__slots__ = ()
def wrap_socket(self, sock, server_side=False, def wrap_socket(self, sock, server_side=False,
do_handshake_on_connect=True, do_handshake_on_connect=True,
suppress_ragged_eofs=True, suppress_ragged_eofs=True,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment