Skip to content

Commit

Permalink
Apply Monkey patch for Python3.8
Browse files Browse the repository at this point in the history
  • Loading branch information
noriki-nakamura committed Apr 26, 2021
1 parent 78add5e commit 4338ec4
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions sslpsk/sslpsk.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,11 +51,11 @@ def _sslobj(sock):
functions interface.
"""
pass
if isinstance(sock._sslobj, _ssl._SSLSocket):
return sock._sslobj
else:
if (3, 5) <= sys.version_info <= (3, 7):
return sock._sslobj._sslobj
else:
return sock._sslobj
sslpsk.sslpsk._sslobj = _sslobj

def _python_psk_server_callback(ssl_id, identity):
"""Called by _sslpsk.c to return the psk for the socket with the specified
Expand Down

0 comments on commit 4338ec4

Please sign in to comment.