Skip to content

Commit b106e24

Browse files
committed
Fix redundant exception type in Auto3DSeg utils
ModuleNotFoundError is a subclass of ImportError, so catching both is redundant. Fixes flake8-bugbear B014. Signed-off-by: Soumya Snigdha Kundu <soumya_snigdha.kundu@kcl.ac.uk>
1 parent 3b5f418 commit b106e24

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

monai/auto3dseg/utils.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -495,7 +495,7 @@ def algo_from_json(filename: str, template_path: PathLike | None = None, **kwarg
495495
if path and path in sys.path:
496496
sys.path.remove(path)
497497
break
498-
except (ModuleNotFoundError, ImportError) as e:
498+
except ImportError as e:
499499
if path and path in sys.path:
500500
sys.path.remove(path)
501501
logging.debug(f"Failed to instantiate {target} with path {path}: {e}")

0 commit comments

Comments
 (0)