Merge pull request #53 from BoboTiG/fix-resource-warning

Fix ResourceWarning: unclosed file in setup.py
This commit is contained in:
Andrew Senetar 2021-01-12 16:53:59 -06:00 committed by GitHub
當前提交 ec73b44c43
沒有發現已知的金鑰在資料庫的簽署中
GPG Key ID: 4AEE18F83AFDEB23
共有 2 個文件被更改,包括 4 次插入6 次删除

查看文件

@ -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):

查看文件

@ -17,9 +17,8 @@ CLASSIFIERS = [
"Topic :: Desktop Environment :: File Managers",
]
LONG_DESCRIPTION = (
open("README.rst", "rt").read() + "\n\n" + open("CHANGES.rst", "rt").read()
)
with open("README.rst", "rt") as f1, open("CHANGES.rst", "rt") as f2:
LONG_DESCRIPTION = f1.read() + "\n\n" + f2.read()
setup(
name="Send2Trash",