Skip to content

Commit b988c04

Browse files
Update cf/mixin/fielddomain.py to improve deletion status check
Co-authored-by: David Hassell <[email protected]>
1 parent e3a6600 commit b988c04

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

cf/mixin/fielddomain.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2490,8 +2490,13 @@ def del_construct(self, *identity, default=ValueError(), **filter_kwargs):
24902490
cyclic_axes = self._cyclic.copy()
24912491

24922492
deld_construct = super().del_construct(
2493-
*identity, default=default, **filter_kwargs
2493+
*identity, default=None, **filter_kwargs
24942494
)
2495+
if deld_construct is None:
2496+
if default is None:
2497+
return
2498+
2499+
return self._default(default, "Can't find unique construct to remove")
24952500

24962501
# If the construct deleted was a cyclic axes, remove it from the set
24972502
# of stored cyclic axes, to update that appropriately. Do this

0 commit comments

Comments
 (0)