Python 3.7 compatible

This commit is contained in:
z4yx 2020-04-07 16:06:18 +08:00
parent 2c651021e4
commit d204e3aa7f

View File

@ -417,8 +417,14 @@ def garbage_collect():
if DELETE_OLD: if DELETE_OLD:
narinfo = parse_narinfo(path.read_text()) narinfo = parse_narinfo(path.read_text())
path.unlink(missing_ok=True) try:
(working_dir / STORE_DIR / narinfo['URL']).unlink(missing_ok=True) path.unlink()
except:
pass
try:
(working_dir / STORE_DIR / narinfo['URL']).unlink()
except:
pass
if DELETE_OLD: if DELETE_OLD:
logging.info(f' - {deleted} paths deleted') logging.info(f' - {deleted} paths deleted')