summaryrefslogtreecommitdiff
path: root/buildscripts/mobile/adb_monitor.py
diff options
context:
space:
mode:
Diffstat (limited to 'buildscripts/mobile/adb_monitor.py')
-rw-r--r--buildscripts/mobile/adb_monitor.py9
1 files changed, 5 insertions, 4 deletions
diff --git a/buildscripts/mobile/adb_monitor.py b/buildscripts/mobile/adb_monitor.py
index d33a37e08d8..1f7c350f309 100644
--- a/buildscripts/mobile/adb_monitor.py
+++ b/buildscripts/mobile/adb_monitor.py
@@ -132,14 +132,14 @@ class Adb(object):
def systrace_stop(self, output_file=None):
"""Stop the systrace.py script."""
- self._cmd.send_to_process("bye")
+ self._cmd.send_to_process(b"bye")
with open(self._tempfile) as fh:
buff = fh.read()
os.remove(self._tempfile)
self.logger.debug("systrace_stop: %s", buff)
if "Wrote trace" not in buff:
self.logger.error("CPU file not saved: %s", buff)
- if os.path.isfile(output_file):
+ if output_file and os.path.isfile(output_file):
os.remove(output_file)
@@ -410,8 +410,9 @@ def main(): #pylint: disable=too-many-statements
output_files[options.cpu_file] = fileops.getmtime(options.cpu_file)
LOGGER.setLevel(options.log_level.upper())
- LOGGER.info("This program can be cleanly terminated by issuing the following command:"
- "\n\t\t'kill -INT %d'", os.getpid())
+ LOGGER.info(
+ "This program can be cleanly terminated by issuing the following command:"
+ "\n\t\t'kill -INT %d'", os.getpid())
adb = Adb(options.adb_binary)
LOGGER.info("Detected devices by adb:\n%s%s", adb.devices(), adb.device_available())