File tree Expand file tree Collapse file tree 1 file changed +10
-2
lines changed Expand file tree Collapse file tree 1 file changed +10
-2
lines changed Original file line number Diff line number Diff line change @@ -674,13 +674,15 @@ def __new__(
674
674
# Read the file
675
675
# ----------------------------------------------------
676
676
fmts = fmt .copy ()
677
+
678
+ # Record unknown file format errors
677
679
file_format_errors = []
678
680
679
681
if fmts .intersection (("netCDF" , "CDL" )):
680
682
try :
681
683
file_contents = super ().__new__ (
682
684
cls ,
683
- filename ,
685
+ filename = filename ,
684
686
external = external ,
685
687
extra = extra ,
686
688
verbose = verbose ,
@@ -709,7 +711,9 @@ def __new__(
709
711
file_format_errors = ()
710
712
if file_contents or not ignore_read_error :
711
713
# 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.
713
717
fmts = set ()
714
718
ftype = "netCDF"
715
719
@@ -735,6 +739,10 @@ def __new__(
735
739
else :
736
740
file_format_errors = ()
737
741
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.
738
746
fmts = set ()
739
747
ftype = "UM"
740
748
You can’t perform that action at this time.
0 commit comments