We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 33f6774 commit a7cc3c8Copy full SHA for a7cc3c8
nibabel/openers.py
@@ -12,19 +12,22 @@
12
import bz2
13
import gzip
14
import sys
15
+import warnings
16
from os.path import splitext
17
from distutils.version import StrictVersion
18
19
# is indexed_gzip present and modern?
20
try:
21
from indexed_gzip import SafeIndexedGzipFile, __version__ as version
22
- if StrictVersion(version) < StrictVersion("0.6.0"):
23
- raise ImportError('indexed_gzip is present, but too old '
24
- '(>= 0.6.0 required): {})'.format(version))
+ HAVE_INDEXED_GZIP = True
+
25
+ if StrictVersion(version) < StrictVersion('0.6.0'):
26
+ warnings.warn('indexed_gzip is present, but too old '
27
+ '(>= 0.6.0 required): {})'.format(version))
28
+ HAVE_INDEXED_GZIP = False
29
30
del version
- HAVE_INDEXED_GZIP = True
31
32
except ImportError:
33
HAVE_INDEXED_GZIP = False
0 commit comments