Skip to content

armgit / rembg

Public Imported from GitHub
0

Rembg is a tool to remove images background

fix: silence bandit B112 in the migration helper

Daniel Gatis3988b6c1b2a3
diff --git a/rembg/commands/m_command.py b/rembg/commands/m_command.py
index c4e4cb8..a170cca 100644
--- a/rembg/commands/m_command.py
+++ b/rembg/commands/m_command.py
@@ -17,7 +17,9 @@ def _model_for_file(fname: str) -> str | None:
for session_class in sessions_class:
try:
names.append(session_class.name())
- except Exception:
+ except Exception: # nosec B112 - a session that cannot report its own
+ # name just cannot claim a file; skipping it leaves the file
+ # unrecognised, which is the safe outcome here.
continue
# SAM ships several files, all sharing a `sam_` prefix.