8000 STY: Apply ruff/flake8-type-checking rule TCH002 · nipy/nibabel@495ea82 · GitHub
[go: up one dir, main page]

Skip to content

Commit 495ea82

Browse files
STY: Apply ruff/flake8-type-checking rule TCH002
TCH002 Move third-party import into a type-checking block
1 parent 099abc0 commit 495ea82

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

nibabel/testing/__init__.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,12 +26,14 @@
2626
from .helpers import assert_data_similar, bytesio_filemap, bytesio_round_trip
2727
from .np_features import memmap_after_ufunc
2828

29+
if ty.TYPE_CHECKING:
30+
from importlib_resources.abc import Traversable
31+
2932
try:
3033
from importlib.resources import as_file, files
3134
from importlib.resources.abc import Traversable
3235
except ImportError: # PY38
3336
from importlib_resources import as_file, files
34-
from importlib_resources.abc import Traversable
3537

3638

3739
def get_test_data(

0 commit comments

Comments
 (0)
0