Fixes Carriage Return when testing connected dev
am: 501e6b7cbe
Change-Id: I63c94081405e2eb77b04498578eac8b5afd91595
diff --git a/adb_stress_tests/util.py b/adb_stress_tests/util.py
index 6d6b70b..abc094c 100644
--- a/adb_stress_tests/util.py
+++ b/adb_stress_tests/util.py
@@ -38,10 +38,16 @@
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