1
0
mirror of https://gitlab.com/fdroid/fdroidserver.git synced 2024-11-13 02:30:11 +01:00

Avoid strange outcomes of "adb devices"

This commit is contained in:
Daniel Martí 2013-12-26 19:18:36 +01:00
parent 2757ec60c8
commit 73721b5460

View File

@ -33,7 +33,11 @@ def devices():
p = FDroidPopen(["adb", "devices"])
if p.returncode != 0:
raise Exception("An error occured when finding devices: %s" % p.stderr)
return [l.split()[0] for l in p.stdout.splitlines()[1:-1]]
lines = p.stdout.splitlines()
if len(lines) < 3:
return []
lines = lines[1:-1]
return [l.split()[0] for l in lines]
def main():