Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1744)

Unified Diff: adb/contrib/adb_commands_safe.py

Issue 2609313003: python-adb: Quit early when trying to connect to a missing device. (Closed)
Patch Set: Created 3 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: adb/contrib/adb_commands_safe.py
diff --git a/adb/contrib/adb_commands_safe.py b/adb/contrib/adb_commands_safe.py
index e7dcd5014acadb4111e5f76b001949e308dbeadb..ebc606fb4e9de015bd0c7cb6873bb0bdfaeb783c 100644
--- a/adb/contrib/adb_commands_safe.py
+++ b/adb/contrib/adb_commands_safe.py
@@ -773,12 +773,16 @@ class AdbCommandsSafe(object):
# Do not kill adb, it just means the USB host is likely resetting and
# the device is temporarily unavailable. We can't use
# handle.serial_number since this communicates with the device.
+ # Might take a while for the device to come back. Exit early.
+ break
except common.usb1.USBErrorNotFound as e:
_LOG.warning(
'%s._OpenHandle(): USBErrorNotFound: %s', self.port_path, e)
# Do not kill adb, it just means the USB host is likely resetting (?)
# and the device is temporarily unavailable. We can't use
# handle.serial_number since this communicates with the device.
+ # Might take a while for the device to come back. Exit early.
+ break
except common.usb1.USBErrorBusy as e:
_LOG.warning('%s._OpenHandle(): USBErrorBusy: %s', self.port_path, e)
KillADB()
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698