From bb978c1c3dab40fc5fb12876059df526c85d33ad Mon Sep 17 00:00:00 2001 From: Chris Markiewicz Date: Sun, 8 Sep 2024 02:16:22 -0400 Subject: [PATCH] fix: Import from typing in Python 3.13 --- nibabel/nifti1.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/nibabel/nifti1.py b/nibabel/nifti1.py index a22959dfd..ee6cec53a 100644 --- a/nibabel/nifti1.py +++ b/nibabel/nifti1.py @@ -14,13 +14,18 @@ from __future__ import annotations import json +import sys import typing as ty import warnings from io import BytesIO import numpy as np import numpy.linalg as npl -from typing_extensions import Self, TypeVar # PY312 + +if sys.version_info <= (3, 12): + from typing_extensions import Self, TypeVar # PY312 +else: + from typing import Self, TypeVar from . import analyze # module import from .arrayproxy import get_obj_dtype