Skip to content

Commit 795dd52

Browse files
authored
Merge pull request #34 from dhalbert/check-cpy-version
Complain if trying to use with CPy 4.x
2 parents e6679ab + 8ee9b84 commit 795dd52

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

adafruit_ble/__init__.py

+6
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,12 @@
4343
https://github.com/adafruit/circuitpython/releases
4444
4545
"""
46+
#pylint: disable=wrong-import-position
47+
import sys
48+
if sys.implementation.name == 'circuitpython' and sys.implementation.version[0] <= 4:
49+
raise ImportError(
50+
"This release is not compatible with CircuitPython 4.x; use library release 1.x.x")
51+
#pylint: enable=wrong-import-position
4652

4753
import board
4854
import _bleio

0 commit comments

Comments
 (0)