summaryrefslogtreecommitdiffstats
path: root/tools
diff options
context:
space:
mode:
authortonyg@chromium.org <tonyg@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2014-02-06 20:35:26 +0000
committertonyg@chromium.org <tonyg@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2014-02-06 20:35:26 +0000
commitdc7ca87e238fed16ef8816f4fa575e29a18df212 (patch)
tree6c366d24686bab846355b0ede986604044211fff /tools
parent13442597cc7bf82e63f183642bbcef0d003fac00 (diff)
downloadchromium_src-dc7ca87e238fed16ef8816f4fa575e29a18df212.zip
chromium_src-dc7ca87e238fed16ef8816f4fa575e29a18df212.tar.gz
chromium_src-dc7ca87e238fed16ef8816f4fa575e29a18df212.tar.bz2
[Telemetry] Remove a 2.7 polyfill now that we depend on 2.7.
BUG= Review URL: https://codereview.chromium.org/155483002 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@249487 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'tools')
-rw-r--r--tools/telemetry/telemetry/core/backends/android_rndis.py19
1 files changed, 2 insertions, 17 deletions
diff --git a/tools/telemetry/telemetry/core/backends/android_rndis.py b/tools/telemetry/telemetry/core/backends/android_rndis.py
index 36c089cf..9fa5227 100644
--- a/tools/telemetry/telemetry/core/backends/android_rndis.py
+++ b/tools/telemetry/telemetry/core/backends/android_rndis.py
@@ -13,21 +13,6 @@ from telemetry.core import util
from telemetry.core.backends import adb_commands
-def _CheckOutput(*popenargs, **kwargs):
- """Backport of subprocess.check_output to python 2.6"""
- process = subprocess.Popen(stdout=subprocess.PIPE, *popenargs, **kwargs)
- output, _ = process.communicate()
- retcode = process.poll()
- if retcode:
- cmd = kwargs.get('args')
- if cmd is None:
- cmd = popenargs[0]
- error = subprocess.CalledProcessError(retcode, cmd)
- error.output = output
- raise error
- return output
-
-
class RndisForwarderWithRoot(object):
"""Forwards traffic using RNDIS. Assuming the device has root access.
"""
@@ -91,9 +76,9 @@ class RndisForwarderWithRoot(object):
def _EnumerateHostInterfaces(self):
if sys.platform.startswith('linux'):
- return _CheckOutput(['ip', 'addr']).splitlines()
+ return subprocess.check_output(['ip', 'addr']).splitlines()
elif sys.platform == 'darwin':
- return _CheckOutput(['ifconfig']).splitlines()
+ return subprocess.check_output(['ifconfig']).splitlines()
raise Exception('Platform %s not supported!' % sys.platform)
def _FindHostRndisInterface(self):