1
0
mirror of https://gitee.com/sui-feng-cb/AzurLaneAutoScript1 synced 2026-03-30 03:56:02 +08:00

Fix: Safely delete minitouch_builder

This commit is contained in:
LmeSzinc
2022-02-10 02:28:43 +08:00
parent f7073fbff3
commit 27a666daab

View File

@@ -183,7 +183,7 @@ def retry(func):
def init(): def init():
self.adb_connect(self.serial) self.adb_connect(self.serial)
del self.__dict__['minitouch_builder'] del_cached_property(self, 'minitouch_builder')
# MinitouchError: Received empty data from minitouch # MinitouchError: Received empty data from minitouch
except MinitouchError as e: except MinitouchError as e:
logger.error(e) logger.error(e)
@@ -192,13 +192,13 @@ def retry(func):
self.install_uiautomator2() self.install_uiautomator2()
if self._minitouch_port: if self._minitouch_port:
self.adb_forward_remove(f'tcp:{self._minitouch_port}') self.adb_forward_remove(f'tcp:{self._minitouch_port}')
del self.__dict__['minitouch_builder'] del_cached_property(self, 'minitouch_builder')
# AdbError # AdbError
except AdbError as e: except AdbError as e:
if handle_adb_error(e): if handle_adb_error(e):
def init(): def init():
self.adb_connect(self.serial) self.adb_connect(self.serial)
del self.__dict__['minitouch_builder'] del_cached_property(self, 'minitouch_builder')
else: else:
break break
# Unknown, probably a trucked image # Unknown, probably a trucked image