Skip to content

Commit eee838a

Browse files
committed
load_meshes better handling of non-iterables.
1 parent 2e5bca9 commit eee838a

1 file changed

Lines changed: 6 additions & 1 deletion

File tree

lib/iris/fileformats/netcdf/ugrid_load.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -143,7 +143,12 @@ def load_meshes(uris, var_name=None):
143143
from iris.fileformats.cf import CFReader
144144
import iris.fileformats.netcdf.loader as nc_loader
145145

146-
if isinstance(uris, str):
146+
if (
147+
isinstance(uris, str)
148+
or hasattr(uris, "fromcdl")
149+
or not isinstance(uris, Iterable)
150+
):
151+
# Make a string, Dataset, or other single item, into an iterable.
147152
uris = [uris]
148153

149154
def _categorise(decoded: tuple[str, str, str | None]) -> tuple[str, str, str]:

0 commit comments

Comments
 (0)