lib: Fix silent assertitons
There are a couple of assert statements in the codebase which can make jw-pkg fail without any detail whatsoever if --backtrace is not specified, fix that. Signed-off-by: Jan Lindemann <jan@janware.com>
This commit is contained in:
parent
120a6e4d34
commit
3ac3aff997
7 changed files with 19 additions and 12 deletions
|
|
@ -26,8 +26,10 @@ class Distro(abc.ABC):
|
|||
os_release_str: str|None=None,
|
||||
default_pkg_filter: PackageFilter|None=None,
|
||||
) -> None:
|
||||
assert ec is not None
|
||||
assert id is not None
|
||||
if id is None:
|
||||
raise ValueError(f'Tried to instaniate Distro without id')
|
||||
if ec is None:
|
||||
raise ValueError(f'Tried to instaniate Distro "{id}" without execution context')
|
||||
self.__exec_context = ec
|
||||
self.__id: str|None = None
|
||||
self.__os_release_str: str|None = os_release_str
|
||||
|
|
|
|||
Loading…
Reference in a new issue