From 78a678b395fe4aea7d1958c074c8de201c8b5dc5 Mon Sep 17 00:00:00 2001 From: Adam Kunesh Date: Fri, 1 Dec 2023 13:32:12 -0500 Subject: [PATCH] =?UTF-8?q?=F0=9F=94=A8=20Fix=20import=20from=20=20regardl?= =?UTF-8?q?ess=20of=20python=20version?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- rodi/__init__.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/rodi/__init__.py b/rodi/__init__.py index d367dde..7f27091 100644 --- a/rodi/__init__.py +++ b/rodi/__init__.py @@ -20,10 +20,11 @@ get_type_hints, ) -if sys.version_info >= (3, 9): # pragma: no cover - from typing import _no_init_or_replace_init as _no_init -elif sys.version_info >= (3, 8): # pragma: no cover - from typing import _no_init +if sys.version_info >= (3, 8): # pragma: no cover + try: + from typing import _no_init_or_replace_init as _no_init + except ImportError: # pragma: no cover + from typing import _no_init try: from typing import Protocol