mirror of
https://github.com/galaxyproject/galaxy.git
synced 2026-11-03 21:34:30 +08:00
Fix mypy error for npz.zip.filelist optional access
This commit is contained in:
@@ -4523,7 +4523,7 @@ class Npz(CompressedArchive):
|
||||
def sniff(self, filename: str) -> bool:
|
||||
try:
|
||||
with np.load(filename) as npz:
|
||||
if isinstance(npz, np.lib.npyio.NpzFile) and any(f.filename.endswith(".npy") for f in npz.zip.filelist):
|
||||
if isinstance(npz, np.lib.npyio.NpzFile) and any(f.filename.endswith(".npy") for f in npz.zip.filelist): # type: ignore[union-attr, unused-ignore]
|
||||
return True
|
||||
except Exception:
|
||||
return False
|
||||
|
||||
Reference in New Issue
Block a user