Skip to content

Commit

Permalink
remove try except block
Browse files Browse the repository at this point in the history
(cherry picked from commit 5279f44)
  • Loading branch information
TomHarrop committed Jul 7, 2024
1 parent 8b93094 commit 011a591
Showing 1 changed file with 5 additions and 8 deletions.
13 changes: 5 additions & 8 deletions lib/galaxy/datatypes/binary.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down

0 comments on commit 011a591

Please sign in to comment.