File tree Expand file tree Collapse file tree 2 files changed +7
-9
lines changed
Expand file tree Collapse file tree 2 files changed +7
-9
lines changed Original file line number Diff line number Diff line change 3636import numpy as np
3737
3838from . import openers
39+ from ._compression import HAVE_INDEXED_GZIP
3940from .fileslice import canonical_slicers , fileslice
4041from .volumeutils import apply_read_scaling , array_from_file
4142
@@ -263,7 +264,7 @@ def _should_keep_file_open(self, keep_file_open):
263264 - whether ``self.file_like`` is an an open file handle, or a path to a
264265 ``'.gz'`` file, or a path to a non-gzip file.
265266 - whether ``indexed_gzip`` is present (see
266- :attr:`.openers .HAVE_INDEXED_GZIP`).
267+ :attr:`._compression .HAVE_INDEXED_GZIP`).
267268
268269 An ``ArrayProxy`` object uses two internal flags to manage
269270 ``ImageOpener`` instances and underlying file handles.
@@ -330,7 +331,7 @@ def _should_keep_file_open(self, keep_file_open):
330331 if self ._has_fh ():
331332 return False , False
332333 # if the file is a gzip file, and we have_indexed_gzip,
333- have_igzip = openers . HAVE_INDEXED_GZIP and self .file_like .endswith ('.gz' )
334+ have_igzip = HAVE_INDEXED_GZIP and self .file_like .endswith ('.gz' )
334335
335336 persist_opener = keep_file_open or have_igzip
336337 return keep_file_open , persist_opener
Original file line number Diff line number Diff line change 1010
1111from __future__ import annotations
1212
13- import gzip
1413import io
1514import typing as ty
1615from bz2 import BZ2File
1716from os .path import splitext
1817
19- from ._compression import (HAVE_INDEXED_GZIP ,
20- IndexedGzipFile ,
21- DeterministicGzipFile ,
22- zstd ,
23- gzip_open ,
24- zstd_open )
18+ from ._compression import (
19+ gzip_open ,
20+ zstd_open ,
21+ )
2522
2623if ty .TYPE_CHECKING :
2724 from types import TracebackType
You can’t perform that action at this time.
0 commit comments