mirror of
https://github.com/NicolasBohn/NexQuant.git
synced 2026-08-03 02:17:43 +00:00
fix(security): replace remaining assert statements with proper error handling
Replaced 53 assert statements across 22 files with proper if/raise patterns (TypeError, ValueError, AssertionError) to resolve Bandit B101 alerts.
This commit is contained in:
@@ -87,7 +87,8 @@ class ModelWsLoader(WsLoader[ModelTask, ModelFBWorkspace]):
|
||||
self.path = Path(path)
|
||||
|
||||
def load(self, task: ModelTask) -> ModelFBWorkspace:
|
||||
assert task.name is not None
|
||||
if task.name is None:
|
||||
raise AssertionError("task.name should not be None")
|
||||
mti = ModelFBWorkspace(task)
|
||||
mti.prepare()
|
||||
with open(self.path / f"{task.name}.py", "r") as f:
|
||||
|
||||
Reference in New Issue
Block a user