Skip to content

Commit 8b2a002

Browse files
committed
Changes when sys.implementation is a namespace
1 parent b514b44 commit 8b2a002

File tree

1 file changed

+10
-9
lines changed

1 file changed

+10
-9
lines changed

adafruit_connection_manager.py

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -149,15 +149,16 @@ def get_radio_socketpool(radio):
149149
# versions of the Wiznet5k library or on boards withouut the ssl module
150150
# see https://docs.circuitpython.org/en/latest/shared-bindings/support_matrix.html
151151
ssl_context = None
152-
cp_version = sys.implementation[1]
153-
if pool.SOCK_STREAM == 1 and cp_version >= WIZNET5K_SSL_SUPPORT_VERSION:
154-
try:
155-
import ssl # pylint: disable=import-outside-toplevel
156-
157-
ssl_context = ssl.create_default_context()
158-
except ImportError:
159-
# if SSL not on board, default to fake_ssl_context
160-
pass
152+
if isinstance(sys.implementation, list):
153+
cp_version = sys.implementation[1]
154+
if pool.SOCK_STREAM == 1 and cp_version >= WIZNET5K_SSL_SUPPORT_VERSION:
155+
try:
156+
import ssl # pylint: disable=import-outside-toplevel
157+
158+
ssl_context = ssl.create_default_context()
159+
except ImportError:
160+
# if SSL not on board, default to fake_ssl_context
161+
pass
161162

162163
if ssl_context is None:
163164
ssl_context = create_fake_ssl_context(pool, radio)

0 commit comments

Comments
 (0)