Skip to content

Commit 988c14a

Browse files
committed
fix unit tests
1 parent 81de6e2 commit 988c14a

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/data/write_init_files.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -389,7 +389,9 @@ def write_ic_params(outfile, host_vars, ic_names, registry_constituents):
389389
max_slen = 0
390390
# end if
391391
# Extend max_slen if any constituent names are longer
392-
max_slen = max(max_slen, max(len(x) for x in registry_constituents))
392+
if registry_constituents:
393+
max_slen = max(max_slen, max(len(x) for x in registry_constituents))
394+
# end if
393395

394396
outfile.write(f"integer, public, parameter :: std_name_len = {max_slen}", 1)
395397

0 commit comments

Comments
 (0)