Skip to content

Commit

Permalink
STY: Apply ruff/flake8-type-checking rule TCH002
Browse files Browse the repository at this point in the history
TCH002 Move third-party import into a type-checking block
  • Loading branch information
DimitriPapadopoulos committed Sep 22, 2024
1 parent 2cfabbd commit bb22191
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion nibabel/testing/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,12 +26,14 @@
from .helpers import assert_data_similar, bytesio_filemap, bytesio_round_trip
from .np_features import memmap_after_ufunc

if ty.TYPE_CHECKING:
from importlib_resources.abc import Traversable

try:
from importlib.resources import as_file, files
from importlib.resources.abc import Traversable
except ImportError: # PY38
from importlib_resources import as_file, files
from importlib_resources.abc import Traversable


def get_test_data(
Expand Down

0 comments on commit bb22191

Please sign in to comment.