Skip to content

Commit 141a3ed

Browse files
committed
Guard against invalid mode in jarray function
All the other functions already guard with an assertion.
1 parent 9ec3bb4 commit 141a3ed

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

src/scyjava/_types.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -275,6 +275,9 @@ def jarray(kind, lengths: Sequence):
275275
# instantiate the n-dimensional array
276276
arr = arraytype(lengths[0])
277277

278+
else:
279+
raise RuntimeError(f"Invalid mode: {mode}")
280+
278281
if len(lengths) > 1:
279282
for i in range(len(arr)):
280283
arr[i] = jarray(kind, lengths[1:])

0 commit comments

Comments
 (0)