Annotate in type comments that `absl.logging.fatal` does not return.
`absl.logging.fatal` causes program to abort, unless in rare cases that absl's root logger is overridden.
PiperOrigin-RevId: 363431400
Change-Id: Iaab774451502abe696c66d4396685106151e839a
diff --git a/absl/logging/__init__.py b/absl/logging/__init__.py
index 0b1814d..0165923 100644
--- a/absl/logging/__init__.py
+++ b/absl/logging/__init__.py
@@ -100,6 +100,11 @@
else:
import threading as _thread_lib # For .get_ident().
+try:
+ from typing import NoReturn
+except ImportError:
+ pass
+
FLAGS = flags.FLAGS
@@ -379,6 +384,7 @@
def fatal(msg, *args, **kwargs):
+ # type: (Any, Any, Any) -> NoReturn
"""Logs a fatal message."""
log(FATAL, msg, *args, **kwargs)