Skip to content

Commit

Permalink
Work arounf flake complaint
Browse files Browse the repository at this point in the history
  • Loading branch information
sfiligoi committed Nov 7, 2023
1 parent 85dd7dc commit e15f959
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions biom/util.py
Original file line number Diff line number Diff line change
Expand Up @@ -441,11 +441,11 @@ def biom_open(fp, permission='r'):
opener = h5py.File

if mode in ['U', 'r', 'rb'] and is_gzip(fp):
def opener(fp, mode):
def opener(fp, mode): # noqa
return codecs.getreader('utf-8')(gzip_open(fp, mode))
mode = 'rb' if permission in ['U', 'r'] else permission
elif mode in ['w', 'wb'] and str(fp).endswith('.gz'):
def opener(fp, mode):
def opener(fp, mode): # noqa
codecs.getwriter('utf-8')(gzip_open(fp, mode))

f = opener(fp, mode)
Expand Down

0 comments on commit e15f959

Please sign in to comment.