Skip to content

Commit bb978c1

Browse files
committed
fix: Import from typing in Python 3.13
1 parent 72a93c2 commit bb978c1

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

nibabel/nifti1.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,13 +14,18 @@
1414
from __future__ import annotations
1515

1616
import json
17+
import sys
1718
import typing as ty
1819
import warnings
1920
from io import BytesIO
2021

2122
import numpy as np
2223
import numpy.linalg as npl
23-
from typing_extensions import Self, TypeVar # PY312
24+
25+
if sys.version_info <= (3, 12):
26+
from typing_extensions import Self, TypeVar # PY312
27+
else:
28+
from typing import Self, TypeVar
2429

2530
from . import analyze # module import
2631
from .arrayproxy import get_obj_dtype

0 commit comments

Comments
 (0)