mirror of
https://github.com/f-droid/fdroidserver.git
synced 2025-11-05 23:10:29 +03:00
Avoid strange outcomes of "adb devices"
This commit is contained in:
parent
2757ec60c8
commit
73721b5460
1 changed files with 5 additions and 1 deletions
|
|
@ -33,7 +33,11 @@ def devices():
|
||||||
p = FDroidPopen(["adb", "devices"])
|
p = FDroidPopen(["adb", "devices"])
|
||||||
if p.returncode != 0:
|
if p.returncode != 0:
|
||||||
raise Exception("An error occured when finding devices: %s" % p.stderr)
|
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():
|
def main():
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue