Skip to content

Commit f0f3940

Browse files
authored
Prevent crash by catching ConnectionError in _check_alive() after server stop with wifi-adb (#1158)
1 parent 2eda510 commit f0f3940

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

uiautomator2/core.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -291,7 +291,7 @@ def _check_alive(self) -> bool:
291291
try:
292292
response = _http_request(self._dev, self._device_server_port, "GET", "/ping")
293293
return response.content == b"pong"
294-
except HTTPError:
294+
except (HTTPError, ConnectionError):
295295
return False
296296

297297
def stop_uiautomator(self, wait=True):

0 commit comments

Comments
 (0)