Skip to content

Commit a92c6c9

Browse files
committed
fix for netCDF4 v1.7.3 iterator changes
1 parent 62f0443 commit a92c6c9

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

src/wrf/util.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,13 @@ def is_multi_file(wrfin):
134134
is a single NetCDF file object.
135135
136136
"""
137-
return (isinstance(wrfin, Iterable) and not isstr(wrfin))
137+
try:
138+
iter(wrfin)
139+
is_iterable = True
140+
except Exception:
141+
is_iterable = False
142+
143+
return (is_iterable and not isstr(wrfin))
138144

139145

140146
def has_time_coord(wrfnc):

0 commit comments

Comments
 (0)