From f16f3c4f7af1d632013ea638c684f70cf32a7b26 Mon Sep 17 00:00:00 2001 From: Nils Homer Date: Wed, 22 Nov 2023 08:08:54 -0700 Subject: [PATCH] Feature/support updated mypy nh13 (#74) Fix conditional imports in inspect module --- fgpyo/util/inspect.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/fgpyo/util/inspect.py b/fgpyo/util/inspect.py index 6a69a6b5..dde7b11a 100644 --- a/fgpyo/util/inspect.py +++ b/fgpyo/util/inspect.py @@ -5,9 +5,11 @@ from typing import Type from typing import Union -try: # py>=38 +import sys + +if sys.version_info >= (3, 8): from typing import Literal -except ImportError: # py<38 +else: from typing_extensions import Literal import functools