summaryrefslogtreecommitdiffstats
path: root/contrib
diff options
context:
space:
mode:
authorDavid Pursehouse <david.pursehouse@sonymobile.com>2013-01-18 16:05:54 +0900
committerDavid Pursehouse <david.pursehouse@sonymobile.com>2013-01-18 16:05:54 +0900
commitea8b627b8dbb438cc8e691a91498a927a997b5ff (patch)
treec45fed0cab24d163e2287c2957a507ee85a790e7 /contrib
parentef6b83bd204b028191f9e0e65e4e5ea83192422f (diff)
trivial-rebase: Fix pylint errors
W0622: Redefining built-in 'exit' It is not necessary to explicitly import the `exit` method from the `sys` module. Remove this import. W0622: Redefining built-in 'dict' Rename the variable `dict` to `data` to prevent redefinition of the built-in. W0612: Unused variable 'gsql_stderr' W0612: Unused variable 'args' Prefix unused variables with `_`. Change-Id: I6c4f9a54a3a27eab09c419154f9e2ee6689536de
Diffstat (limited to 'contrib')
-rwxr-xr-xcontrib/trivial_rebase.py11
1 files changed, 5 insertions, 6 deletions
diff --git a/contrib/trivial_rebase.py b/contrib/trivial_rebase.py
index a514b4c7e3..efe4f66b09 100755
--- a/contrib/trivial_rebase.py
+++ b/contrib/trivial_rebase.py
@@ -37,7 +37,6 @@
import json
from optparse import OptionParser
import subprocess
-from sys import exit
class CheckCallError(OSError):
"""CheckCall() returned non-0."""
@@ -68,7 +67,7 @@ def GsqlQuery(sql_query, server, port):
gsql_cmd = ['ssh', '-p', port, server, 'gerrit', 'gsql', '--format',
'JSON', '-c', sql_query]
try:
- (gsql_out, gsql_stderr) = CheckCall(gsql_cmd)
+ (gsql_out, _gsql_stderr) = CheckCall(gsql_cmd)
except CheckCallError, e:
print "return code is %s" % e.retcode
print "stdout and stderr is\n%s%s" % (e.stdout, e.stderr)
@@ -99,9 +98,9 @@ def GetApprovals(changeId, patchset, server, port):
gsql_out = GsqlQuery(sql_query, server, port)
approvals = []
for json_str in gsql_out:
- dict = json.loads(json_str, strict=False)
- if dict["type"] == "row":
- approvals.append(dict["columns"])
+ data = json.loads(json_str, strict=False)
+ if data["type"] == "row":
+ approvals.append(data["columns"])
return approvals
def GetEmailFromAcctId(account_id, server, port):
@@ -151,7 +150,7 @@ def Main():
help="Port to connect to Gerrit's SSH daemon "
"[default: %default]")
- (options, args) = parser.parse_args()
+ (options, _args) = parser.parse_args()
if not options.changeId:
parser.print_help()