Skip to content

Commit

Permalink
fix: avoid unclosed resource warning
Browse files Browse the repository at this point in the history
  • Loading branch information
mrossinek committed Jan 2, 2023
1 parent e6ec20f commit 6b3a4c7
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions src/cobib/config/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -215,6 +215,7 @@ def load(configpath: Optional[Union[str, Path, TextIO, io.TextIOWrapper]] = None
"""
if configpath is not None:
if isinstance(configpath, (TextIO, io.TextIOWrapper)):
configpath.close()
configpath = configpath.name
elif "COBIB_CONFIG" in os.environ:
configpath_env = os.environ["COBIB_CONFIG"]
Expand Down

0 comments on commit 6b3a4c7

Please sign in to comment.