Skip to content

Commit

Permalink
Raise AssertionError rather than assert False
Browse files Browse the repository at this point in the history
assert can be removed as a no-op depending on how python is run.
  • Loading branch information
timj committed Jul 21, 2023
1 parent 226791d commit b6efacd
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion python/lsst/daf/butler/cli/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -843,7 +843,7 @@ def _capture_args(self, ctx: click.Context, args: list[str]) -> None:
if (opt := opts[param_name]) is not None:
captured_args.append(opt)
else:
assert False # All parameters should be an Option or an Argument.
raise AssertionError("All parameters should be an Option or an Argument")
MWCtxObj.getFrom(ctx).args = captured_args

def parse_args(self, ctx: click.Context, args: Any) -> list[str]:
Expand Down
2 changes: 1 addition & 1 deletion python/lsst/daf/butler/core/dimensions/_coordinate.py
Original file line number Diff line number Diff line change
Expand Up @@ -956,7 +956,7 @@ def hasRecords(self) -> bool:

def _record(self, name: str) -> DimensionRecord | None:
# Docstring inherited from DataCoordinate.
assert False
raise AssertionError()

def __reduce__(self) -> tuple[Any, ...]:
return (_BasicTupleDataCoordinate, (self._graph, self._values))
Expand Down

0 comments on commit b6efacd

Please sign in to comment.