1
0
mirror of https://github.com/arsenetar/send2trash.git synced 2026-01-22 14:41:40 +00:00

Fix ResourceWarning: unclosed file in setup.py

Also prevent potential identical warning in `plat_other.py`.
This commit is contained in:
Mickaël Schoentgen
2020-12-01 08:43:12 +01:00
parent 49bc438546
commit cd8d9fb95e
2 changed files with 4 additions and 6 deletions

View File

@@ -112,9 +112,8 @@ def trash_move(src, dst, topdir=None):
check_create(infopath)
os.rename(src, op.join(filespath, destname))
f = open(op.join(infopath, destname + INFO_SUFFIX), "w")
f.write(info_for(src, topdir))
f.close()
with open(op.join(infopath, destname + INFO_SUFFIX), "w") as f:
f.write(info_for(src, topdir))
def find_mount_point(path):