Skip to content

Commit

Permalink
fix ResourceWarning: unclosed file
Browse files Browse the repository at this point in the history
  • Loading branch information
siebrenf authored Dec 7, 2022
1 parent 9143fcd commit 9441a01
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions pyfaidx/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -857,6 +857,9 @@ def _long_name_from_bgzf(self, index_record):
def close(self):
self.__exit__()

def __del__(self):
self.__exit__()

def __enter__(self):
return self

Expand Down

0 comments on commit 9441a01

Please sign in to comment.