diff --git a/src/structlog/_base.py b/src/structlog/_base.py index 9fc6e7ce..eece99d7 100644 --- a/src/structlog/_base.py +++ b/src/structlog/_base.py @@ -176,7 +176,7 @@ def _process_event( if isinstance(event_dict, tuple): # In this case we assume that the last processor returned a tuple # of ``(args, kwargs)`` and pass it right through. - return event_dict # type: ignore[return-value] + return event_dict if isinstance(event_dict, dict): return (), event_dict diff --git a/src/structlog/processors.py b/src/structlog/processors.py index 1faebfd8..351cb100 100644 --- a/src/structlog/processors.py +++ b/src/structlog/processors.py @@ -596,7 +596,7 @@ def _figure_out_exc_info(v: Any) -> ExcInfo: return (v.__class__, v, v.__traceback__) if isinstance(v, tuple): - return v # type: ignore[return-value] + return v if v: return sys.exc_info() # type: ignore[return-value]