mirror of
https://github.com/imcarlost/pidcat-repl.git
synced 2026-08-08 23:17:43 -04:00
Merge pull request #111 from rxwen/fix_race_condition_in_getpid
Fix bug: may fail to get target pid
This commit is contained in:
@@ -254,7 +254,7 @@ def tag_in_tags_regex(tag, tags):
|
|||||||
|
|
||||||
ps_command = base_adb_command + ['shell', 'ps']
|
ps_command = base_adb_command + ['shell', 'ps']
|
||||||
ps_pid = subprocess.Popen(ps_command, stdin=PIPE, stdout=PIPE, stderr=PIPE)
|
ps_pid = subprocess.Popen(ps_command, stdin=PIPE, stdout=PIPE, stderr=PIPE)
|
||||||
while ps_pid.poll() is None:
|
while True:
|
||||||
try:
|
try:
|
||||||
line = ps_pid.stdout.readline().decode('utf-8', 'replace').strip()
|
line = ps_pid.stdout.readline().decode('utf-8', 'replace').strip()
|
||||||
except KeyboardInterrupt:
|
except KeyboardInterrupt:
|
||||||
|
|||||||
Reference in New Issue
Block a user