Skip to content

Commit c2052c1

Browse files
committed
Give clear error about bit length on import
1 parent 3258843 commit c2052c1

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

jepler_udecimal/__init__.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -160,6 +160,11 @@
160160

161161
if sys.implementation.name == "circuitpython":
162162

163+
if not hasattr(int, "bit_length"):
164+
raise ImportError(
165+
"jepler_udecimal requires int.bit_length. Use CircuitPython 6.0.0-rc.1 or newer."
166+
)
167+
163168
def _as_integer_ratio(f):
164169
m, e = _math.frexp(f)
165170
m = round(m * (1 << 53))

0 commit comments

Comments
 (0)