Merge pull request #261 from v3ucn/解决删除文件不存在的bug

修改文件可能不存在的bug
This commit is contained in:
RVC-Boss 2024-01-28 20:19:53 +08:00 committed by GitHub
commit 383df7ed4a
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -16,7 +16,11 @@ if(os.path.exists(tmp)):
if(name=="jieba.cache"):continue
path="%s/%s"%(tmp,name)
delete=os.remove if os.path.isfile(path) else shutil.rmtree
delete(path)
try:
delete(path)
except Exception as e:
print(str(e))
pass
import site
site_packages_roots = []
for path in site.getsitepackages():