diff options
author | cpilch <cpilch@google.com> | 2017-03-28 17:38:53 +0000 |
---|---|---|
committer | android-build-merger <android-build-merger@google.com> | 2017-03-28 17:38:53 +0000 |
commit | 3c8d72d8cd039be229978504ace8cb032fc003da (patch) | |
tree | 7c970d4f24950acd774699c71e0d6128c9af851a | |
parent | 21d232361ad5d71caef6fe28b1d1cc89daabb9a5 (diff) | |
parent | 21a96408c5f4c882f00e11d952a1e327b1863d9f (diff) | |
download | adt-infra-3c8d72d8cd039be229978504ace8cb032fc003da.tar.gz |
Fixes Carriage Return when testing connected dev am: 501e6b7cbe
am: 21a96408c5
Change-Id: I26f44c67132f77a534db37a9ce97b721af1ecb7b
-rw-r--r-- | adb_stress_tests/util.py | 12 |
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 |