Skip to content

Commit 8b127c1

Browse files
committed
dev
1 parent 03ed6ab commit 8b127c1

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed

cf/read_write/read.py

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -674,13 +674,15 @@ def __new__(
674674
# Read the file
675675
# ----------------------------------------------------
676676
fmts = fmt.copy()
677+
678+
# Record unknown file format errors
677679
file_format_errors = []
678680

679681
if fmts.intersection(("netCDF", "CDL")):
680682
try:
681683
file_contents = super().__new__(
682684
cls,
683-
filename,
685+
filename=filename,
684686
external=external,
685687
extra=extra,
686688
verbose=verbose,
@@ -709,7 +711,9 @@ def __new__(
709711
file_format_errors = ()
710712
if file_contents or not ignore_read_error:
711713
# Zero or more fields/domains were
712-
# successfully read
714+
# successfully read. Set 'fmts' to an
715+
# empty set so that no other file formats
716+
# are attempted.
713717
fmts = set()
714718
ftype = "netCDF"
715719

@@ -735,6 +739,10 @@ def __new__(
735739
else:
736740
file_format_errors = ()
737741
if file_contents or not ignore_read_error:
742+
# Zero or more fields/domains were
743+
# successfully read. Set 'fmts' to an
744+
# empty set so that no other file formats
745+
# are attempted.
738746
fmts = set()
739747
ftype = "UM"
740748

0 commit comments

Comments
 (0)