From 456d88a52c82d9d61d21045a5bb876f9ba9fed2c Mon Sep 17 00:00:00 2001 From: Irony <892768447@qq.com> Date: Wed, 3 Aug 2022 00:00:42 +0800 Subject: [PATCH] fix delete --- build.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/build.py b/build.py index c6f6a6a..07499ac 100644 --- a/build.py +++ b/build.py @@ -161,7 +161,10 @@ def decompressLib(): for d in paths: path = os.path.join('tmp/PyQt5/Qt', d) try: - shutil.rmtree(path, ignore_errors=True) + if os.path.isdir(path): + shutil.rmtree(path, ignore_errors=True) + else: + os.unlink(path) except Exception as e: print('remove ', path, e)