Skip to content

Commit

Permalink
Use with statement
Browse files Browse the repository at this point in the history
  • Loading branch information
nsoranzo committed Jul 2, 2018
1 parent a1bedf4 commit 256d901
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion lib/galaxy/util/checkers.py
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,8 @@ def check_gzip(file_path, check_content=True):
# If the file is Bam, it should already have been detected as such, so we'll just check
# for sff format.
try:
header = gzip.open(file_path, 'rb').read(4)
with gzip.open(file_path, 'rb') as fh:
header = fh.read(4)
if header == b'.sff':
return (True, True)
except Exception:
Expand Down

0 comments on commit 256d901

Please sign in to comment.