From 87b58b4af8a65db65142533aec0f8013604fd408 Mon Sep 17 00:00:00 2001 From: Michael Waskom Date: Thu, 22 Feb 2024 20:29:27 +0000 Subject: [PATCH] Hacky way to get Python3.8 compatability --- modal/_container_entrypoint.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/modal/_container_entrypoint.py b/modal/_container_entrypoint.py index d564e907bc..c98b6fbf84 100644 --- a/modal/_container_entrypoint.py +++ b/modal/_container_entrypoint.py @@ -59,7 +59,13 @@ from .partial_function import _find_callables_for_obj, _PartialFunctionFlags if TYPE_CHECKING: - from types import ModuleType, TracebackType + from types import ModuleType + + try: + from types import TracebackType + except ImportError: + # Python 3.8 + TracebackType = Any ExceptionInfo = Tuple[Optional[Type[BaseException]], Optional[BaseException], Optional[TracebackType]]