From 425727ef20987270ad5153be7eaed0bd6c5d7f3d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=81=8D=E5=85=AE=E6=83=9A=E5=85=AE?= <101191390+HIllya51@users.noreply.github.com> Date: Wed, 22 May 2024 15:21:34 +0800 Subject: [PATCH] opti --- LunaTranslator/LunaTranslator/gui/usefulwidget.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/LunaTranslator/LunaTranslator/gui/usefulwidget.py b/LunaTranslator/LunaTranslator/gui/usefulwidget.py index 30ea64b9..e4403a25 100644 --- a/LunaTranslator/LunaTranslator/gui/usefulwidget.py +++ b/LunaTranslator/LunaTranslator/gui/usefulwidget.py @@ -647,7 +647,9 @@ class auto_select_webview(QWidget): def clearcache(self): if self.lastcachehtml and os.path.exists(self.lastcachehtml): - os.remove(self.lastcachehtml) + lastcachehtml = self.lastcachehtml + self.lastcachehtml = None + os.remove(lastcachehtml) def __init__(self, parent) -> None: super().__init__(parent)