Index: build/android/pylib/forwarder.py |
diff --git a/build/android/pylib/forwarder.py b/build/android/pylib/forwarder.py |
index ba81d9c7c3ccc9f2cb0a446e3dfaf6e2a5ef9051..bb478bcd8c9ebfde409dbd908ca73b4d7664f72c 100644 |
--- a/build/android/pylib/forwarder.py |
+++ b/build/android/pylib/forwarder.py |
@@ -6,15 +6,10 @@ import fcntl |
import logging |
import os |
import psutil |
-import re |
-import sys |
-import time |
-import android_commands |
-import cmd_helper |
-import constants |
- |
-from pylib import valgrind_tools |
+from . import cmd_helper |
+from . import constants |
+from . import valgrind_tools |
def _GetProcessStartTime(pid): |
@@ -28,6 +23,7 @@ class _FileLock(object): |
multiprocessing Python module is used. |
""" |
def __init__(self, path): |
+ self._fd = -1 |
self._path = path |
def __enter__(self): |
@@ -36,7 +32,7 @@ class _FileLock(object): |
raise Exception('Could not open file %s for reading' % self._path) |
fcntl.flock(self._fd, fcntl.LOCK_EX) |
- def __exit__(self, type, value, traceback): |
+ def __exit__(self, _exception_type, _exception_value, traceback): |
fcntl.flock(self._fd, fcntl.LOCK_UN) |
os.close(self._fd) |
@@ -154,7 +150,7 @@ class Forwarder(object): |
def DevicePortForHostPort(host_port): |
"""Returns the device port that corresponds to a given host port.""" |
with _FileLock(Forwarder._LOCK_PATH): |
- (device_serial, device_port) = Forwarder._GetInstanceLocked( |
+ (_device_serial, device_port) = Forwarder._GetInstanceLocked( |
None)._host_to_device_port_map.get(host_port) |
return device_port |
@@ -319,7 +315,7 @@ class Forwarder(object): |
logging.info('Killing device_forwarder.') |
if not adb.FileExistsOnDevice(Forwarder._DEVICE_FORWARDER_PATH): |
return |
- (exit_code, output) = adb.GetShellCommandStatusAndOutput( |
+ adb.GetShellCommandStatusAndOutput( |
'%s %s --kill-server' % (tool.GetUtilWrapper(), |
Forwarder._DEVICE_FORWARDER_PATH)) |
# TODO(pliard): Remove the following call to KillAllBlocking() when we are |