Skip to content

Commit 7895e12

Browse files
committed
Make Python 3.9 compatible: Replace match statement with if/elif
1 parent 72cc187 commit 7895e12

1 file changed

Lines changed: 5 additions & 6 deletions

File tree

aiida_mlip/helpers/converters.py

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -129,12 +129,11 @@ def kwarg_to_param(params: dict[str, Any]) -> list[str]:
129129

130130
for key, val in params.items():
131131
key = key.replace("_", "-")
132-
match val:
133-
case bool() if val:
132+
if isinstance(val, bool):
133+
if val:
134134
cmdline_params.append(f"--{key}")
135-
case bool():
135+
else:
136136
cmdline_params.append(f"--no-{key}")
137-
case _:
138-
cmdline_params.extend((f"--{key}", str(val)))
139-
137+
else:
138+
cmdline_params.extend((f"--{key}", str(val)))
140139
return cmdline_params

0 commit comments

Comments
 (0)