Skip to content

Commit b410d92

Browse files
committed
RF: Import _compression module rather than individual symbols to ease testing/mocking
1 parent 44745ac commit b410d92

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

nibabel/arrayproxy.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@
3636
import numpy as np
3737

3838
from . import openers
39-
from ._compression import HAVE_INDEXED_GZIP
39+
from . import _compression
4040
from .fileslice import canonical_slicers, fileslice
4141
from .volumeutils import apply_read_scaling, array_from_file
4242

@@ -331,7 +331,7 @@ def _should_keep_file_open(self, keep_file_open):
331331
if self._has_fh():
332332
return False, False
333333
# if the file is a gzip file, and we have_indexed_gzip,
334-
have_igzip = HAVE_INDEXED_GZIP and self.file_like.endswith('.gz')
334+
have_igzip = _compression.HAVE_INDEXED_GZIP and self.file_like.endswith('.gz')
335335

336336
persist_opener = keep_file_open or have_igzip
337337
return keep_file_open, persist_opener

0 commit comments

Comments
 (0)