Skip to content

Commit 65105bc

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

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/imagej/__init__.py

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

0 commit comments

Comments
 (0)