From c61aa293955a4b57d3e6ee97e2e39ceb35313c81 Mon Sep 17 00:00:00 2001 From: bpinsard Date: Tue, 16 Jan 2024 10:13:50 -0500 Subject: [PATCH] fix py3.11 typing import --- heudiconv/dicoms.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/heudiconv/dicoms.py b/heudiconv/dicoms.py index b9734d7f..1526ef28 100644 --- a/heudiconv/dicoms.py +++ b/heudiconv/dicoms.py @@ -9,7 +9,6 @@ from pathlib import Path import sys import tarfile -from typing_extensions import Protocol from typing import TYPE_CHECKING, Any, Dict, Hashable, List, NamedTuple, Optional, Union, overload from unittest.mock import patch import warnings @@ -27,9 +26,13 @@ if TYPE_CHECKING: if sys.version_info >= (3, 8): - from typing import Literal + from typing import Literal, Protocol else: - from typing_extensions import Literal + from typing_extensions import Literal, Protocol +if sys.version_info >= (3, 8): + from typing import Protocol +else: + from typing_extensions import Protocol with warnings.catch_warnings(): warnings.simplefilter("ignore")