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")