diff --git a/tools/python/jwutils/log.py b/tools/python/jwutils/log.py index 56990a7..f7ad37a 100644 --- a/tools/python/jwutils/log.py +++ b/tools/python/jwutils/log.py @@ -123,8 +123,9 @@ def get_caller_pos(up: int = 1, kwargs: Optional[dict[str, Any]] = None) -> Tupl del kwargs['caller'] return r caller = inspect.stack()[up+1] - mod = inspect.getmodule(caller[0]).__name__ - return (mod, basename(caller.filename), caller.lineno) + mod = inspect.getmodule(caller[0]) + mod_name = '' if mod is None else mod.__name__ + return (mod_name, basename(caller.filename), caller.lineno) def slog_m(prio: int, *args, **kwargs) -> None: # export if prio > _level: