Skip to content

Commit 8ee3b56

Browse files
committed
Work around no unused ignores
Seems pretty silly, but since it can't be turned off on a line-by-line basis this is probably better than changing the mypy config.
1 parent 7e9c02b commit 8ee3b56

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

lib/galaxy/util/compression_utils.py

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
Optional,
1818
overload,
1919
Tuple,
20+
TYPE_CHECKING,
2021
Union,
2122
)
2223

@@ -31,10 +32,13 @@
3132
is_gzip,
3233
)
3334

34-
try:
35+
if TYPE_CHECKING:
3536
from isal import isal_zlib
36-
except ImportError:
37-
isal_zlib = None # type: ignore[assignment]
37+
else:
38+
try:
39+
from isal import isal_zlib
40+
except ImportError:
41+
isal_zlib = None
3842

3943

4044
log = logging.getLogger(__name__)

0 commit comments

Comments
 (0)