Skip to content

Commit

Permalink
Fix ResourceWarning by properly closing file
Browse files Browse the repository at this point in the history
  • Loading branch information
kkovary committed Sep 18, 2023
1 parent 22b5bb0 commit 7c08855
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion datamol/mol.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,8 @@
AROMATIC_BOND = Chem.rdchem.BondType.AROMATIC
DATIVE_BOND = Chem.rdchem.BondType.DATIVE
UNSPECIFIED_BOND = Chem.rdchem.BondType.UNSPECIFIED
SALT_SOLVENT_PATH = datamol.data.open_datamol_data_file("salts_solvents.smi").name
with datamol.data.open_datamol_data_file("salts_solvents.smi") as file_obj:
SALT_SOLVENT_PATH = file_obj.name
SALT_SOLVENT_REMOVER = SaltRemover(defnFilename=SALT_SOLVENT_PATH)


Expand Down

0 comments on commit 7c08855

Please sign in to comment.