Fix variable aliasing. Fixes pylint W0623.
I'm not sure why it hasn't triggered before.
[email protected]
BUG=
TEST=
Review URL: http://codereview.chromium.org/9172002
git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@117054 0039d316-1c4b-4281-b951-d872f2087c98
diff --git a/tests/subprocess2_test.py b/tests/subprocess2_test.py
index d932179..917e106 100755
--- a/tests/subprocess2_test.py
+++ b/tests/subprocess2_test.py
@@ -1,5 +1,5 @@
#!/usr/bin/env python
-# Copyright (c) 2011 The Chromium Authors. All rights reserved.
+# Copyright (c) 2012 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
@@ -253,8 +253,8 @@
subp.check_output(
e + ['--fail', '--stdout'], universal_newlines=un)
self.fail()
- except subp.CalledProcessError, e:
- self._check_exception(subp, e, c('A\nBB\nCCC\n'), None, 64)
+ except subp.CalledProcessError, exception:
+ self._check_exception(subp, exception, c('A\nBB\nCCC\n'), None, 64)
self._run_test(fn)
def test_check_output_throw_no_stderr(self):
@@ -265,8 +265,8 @@
subp.check_output(
e + ['--fail', '--stderr'], universal_newlines=un)
self.fail()
- except subp.CalledProcessError, e:
- self._check_exception(subp, e, c(''), None, 64)
+ except subp.CalledProcessError, exception:
+ self._check_exception(subp, exception, c(''), None, 64)
self._run_test(fn)
def test_check_output_throw_stderr(self):
@@ -279,8 +279,8 @@
stderr=subp.PIPE,
universal_newlines=un)
self.fail()
- except subp.CalledProcessError, e:
- self._check_exception(subp, e, '', c('a\nbb\nccc\n'), 64)
+ except subp.CalledProcessError, exception:
+ self._check_exception(subp, exception, '', c('a\nbb\nccc\n'), 64)
self._run_test(fn)
def test_check_output_throw_stderr_stdout(self):
@@ -293,8 +293,8 @@
stderr=subp.STDOUT,
universal_newlines=un)
self.fail()
- except subp.CalledProcessError, e:
- self._check_exception(subp, e, c('a\nbb\nccc\n'), None, 64)
+ except subp.CalledProcessError, exception:
+ self._check_exception(subp, exception, c('a\nbb\nccc\n'), None, 64)
self._run_test(fn)
def test_check_call_throw(self):
@@ -302,8 +302,8 @@
try:
subp.check_call(self.exe + ['--fail', '--stderr'])
self.fail()
- except subp.CalledProcessError, e:
- self._check_exception(subp, e, None, None, 64)
+ except subp.CalledProcessError, exception:
+ self._check_exception(subp, exception, None, None, 64)
def test_redirect_stderr_to_stdout_pipe(self):
def fn(c, e, un, subp):
@@ -503,8 +503,8 @@
stderr=stderr.append,
universal_newlines=un)
self.fail()
- except subprocess2.CalledProcessError, e:
- self._check_exception(e, '', None, 64)
+ except subprocess2.CalledProcessError, exception:
+ self._check_exception(exception, '', None, 64)
self.assertEquals(c('a\nbb\nccc\n'), ''.join(stderr))
self._run_test(fn)