Skip to content

Commit 189f1a6

Browse files
committed
Check if Mode is a str
If you initialize the gateway without parameters, mode is *not* a string thus causing a "no such method" error when checking for the ":force" option.
1 parent 1c98a15 commit 189f1a6

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/imagej/__init__.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1207,7 +1207,11 @@ def init(
12071207
12081208
ij = imagej.init("sc.fiji:fiji", mode=imagej.Mode.GUI)
12091209
"""
1210-
force = mode.endswith(":force")
1210+
if isinstance(mode, str):
1211+
force = mode.endswith(":force")
1212+
else:
1213+
force = False
1214+
12111215
if force:
12121216
mode = mode[:-6]
12131217

0 commit comments

Comments
 (0)