From feebb873efa49c26c598f876feddfb62e8aa383b Mon Sep 17 00:00:00 2001 From: Kun Wang <ifreedom.cn@gmail.com> Date: Sat, 5 Aug 2017 18:17:50 +0800 Subject: [PATCH] Fix blank line cause silent quit. --- pidcat.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/pidcat.py b/pidcat.py index efaa078..ec49f79 100755 --- a/pidcat.py +++ b/pidcat.py @@ -272,12 +272,16 @@ def tag_in_tags_regex(tag, tags): while adb.poll() is None: try: - line = adb.stdout.readline().decode('utf-8', 'replace').strip() + line = adb.stdout.readline() except KeyboardInterrupt: break if len(line) == 0: break + line = line.decode('utf-8', 'replace').strip() + if len(line) == 0: + continue + bug_line = BUG_LINE.match(line) if bug_line is not None: continue