From 5279f446a5bee13a6669d9f3f1a17d11a48cffce Mon Sep 17 00:00:00 2001 From: Tom Harrop Date: Tue, 25 Jun 2024 06:44:13 +1000 Subject: [PATCH] remove try except block --- lib/galaxy/datatypes/binary.py | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/lib/galaxy/datatypes/binary.py b/lib/galaxy/datatypes/binary.py index 7fc9f4652105..4bcb3f8488a5 100644 --- a/lib/galaxy/datatypes/binary.py +++ b/lib/galaxy/datatypes/binary.py @@ -3777,14 +3777,11 @@ class Pod5(Binary): def sniff(self, filename: str) -> bool: expected_signature = bytes([0x8B, 0x50, 0x4F, 0x44, 0x0D, 0x0A, 0x1A, 0x0A]) - try: - with open(filename, "rb") as f: - first_8_bytes = f.read(8) - f.seek(-8, 2) - last_8_bytes = f.read(8) - return first_8_bytes == expected_signature and last_8_bytes == expected_signature - except Exception: - return False + with open(filename, "rb") as f: + first_8_bytes = f.read(8) + f.seek(-8, 2) + last_8_bytes = f.read(8) + return first_8_bytes == expected_signature and last_8_bytes == expected_signature class SearchGuiArchive(CompressedArchive):