Skip to content

Commit d2972ce

Browse files
committed
RF: Always use indexed_gzip for read access to gz files
1 parent a65cfd2 commit d2972ce

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

nibabel/openers.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -89,9 +89,9 @@ def _gzip_open(filename, mode='rb', compresslevel=9, keep_open=False):
8989
# use indexed_gzip if possible for faster read access. If keep_open ==
9090
# True, we tell IndexedGzipFile to keep the file handle open. Otherwise
9191
# the IndexedGzipFile will close/open the file on each read.
92-
if HAVE_INDEXED_GZIP and keep_open in (True, 'auto') and mode == 'rb':
92+
if HAVE_INDEXED_GZIP and mode == 'rb':
9393
gzip_file = IndexedGzipFile(
94-
filename, drop_handles=keep_open == 'auto')
94+
filename, drop_handles=keep_open is not True)
9595

9696
# Fall-back to built-in GzipFile (wrapped with the BufferedGzipFile class
9797
# defined above)

0 commit comments

Comments
 (0)