Skip to content

Changes when sys.implementation is a namespace #19

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 10 additions & 9 deletions adafruit_connection_manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -149,15 +149,16 @@ def get_radio_socketpool(radio):
# versions of the Wiznet5k library or on boards withouut the ssl module
# see https://docs.circuitpython.org/en/latest/shared-bindings/support_matrix.html
ssl_context = None
cp_version = sys.implementation[1]
if pool.SOCK_STREAM == 1 and cp_version >= WIZNET5K_SSL_SUPPORT_VERSION:
try:
import ssl # pylint: disable=import-outside-toplevel

ssl_context = ssl.create_default_context()
except ImportError:
# if SSL not on board, default to fake_ssl_context
pass
if isinstance(sys.implementation, list):
cp_version = sys.implementation[1]
if pool.SOCK_STREAM == 1 and cp_version >= WIZNET5K_SSL_SUPPORT_VERSION:
try:
import ssl # pylint: disable=import-outside-toplevel

ssl_context = ssl.create_default_context()
except ImportError:
# if SSL not on board, default to fake_ssl_context
pass

if ssl_context is None:
ssl_context = create_fake_ssl_context(pool, radio)
Expand Down
Loading