summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorcpilch <cpilch@google.com>2017-03-28 17:47:25 +0000
committerandroid-build-merger <android-build-merger@google.com>2017-03-28 17:47:25 +0000
commit9c98e8b412cdffca50f651a28a18425ecc32a066 (patch)
tree6f55c349f629af3c2a120d81731e28572d88eb7e
parent0c94218c7ab406176b4a0957e489d556289e7110 (diff)
parent9836cad9c88de77cd2bb9195763dba13ee53af8d (diff)
downloadadt-infra-9c98e8b412cdffca50f651a28a18425ecc32a066.tar.gz
Fixes Carriage Return when testing connected dev am: 501e6b7cbe am: 21a96408c5 am: 3c8d72d8cd
am: 9836cad9c8 Change-Id: I9887499577abfb9d2dfc57909ec3f23cc764384d
-rw-r--r--adb_stress_tests/util.py12
1 files changed, 9 insertions, 3 deletions
diff --git a/adb_stress_tests/util.py b/adb_stress_tests/util.py
index 6d6b70b7..abc094c4 100644
--- a/adb_stress_tests/util.py
+++ b/adb_stress_tests/util.py
@@ -38,10 +38,16 @@ def get_connected_devices():
output, error = proc.communicate()
connected = []
# Collect connected devices.
- for emulator_entry in output.split('\n')[1:]:
+ # Note that since Windows includes a carriage return, we
+ # do it in a seperate loop.
+ if platform.system() is not 'Windows':
+ for emulator_entry in output.split('\n')[1:]:
if emulator_entry != '':
- connected.append(emulator_entry.split('\t')[0])
-
+ connected.append(emulator_entry.split('\t')[0])
+ else:
+ for emulator_entry in output.split('\r\n')[1:]:
+ if emulator_entry != '':
+ connected.append(emulator_entry.split('\t')[0])
return connected