Skip to content

Commit e8140ed

Browse files
committed
Explicitly check for None
The previous "if not val" also triggers if the parameter is a boolean that has the value "False" and therefore wrongly excludes those. Checking for "is None" only triggers if the .get() call fails and returns its default value (None).
1 parent c58fa13 commit e8140ed

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

src/imcflibs/imagej/misc.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -856,7 +856,7 @@ def save_script_parameters(
856856
# TODO: discuss if this approach is fine within Fiji/Jython
857857
try:
858858
val = inputs.get(key)
859-
if not val: # required for testing in CPython
859+
if val is None: # required for testing in CPython
860860
raise KeyError("failure looking up value for '%s'" % key)
861861
f.write("%s: %s\n" % (key, str(val)))
862862
saved += 1

0 commit comments

Comments
 (0)