Largely reduce the number of pylint warnings and fix one typo.

Most of them are style issues or variable aliasing.

TEST=Can almost enable pylint warnings
BUG=none

Review URL: http://codereview.chromium.org/4360002

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@64908 0039d316-1c4b-4281-b951-d872f2087c98
This commit is contained in:
maruel@chromium.org
2010-11-03 14:08:31 +00:00
parent 716268585a
commit cb2985fb69
17 changed files with 82 additions and 75 deletions

View File

@@ -14,7 +14,6 @@
"""Generic utils."""
import copy
import errno
import logging
import os
@@ -300,7 +299,8 @@ def SoftClone(obj):
"""Clones an object. copy.copy() doesn't work on 'file' objects."""
if obj.__class__.__name__ == 'SoftCloned':
return obj
class SoftCloned(object): pass
class SoftCloned(object):
pass
new_obj = SoftCloned()
for member in dir(obj):
if member.startswith('_'):
@@ -389,7 +389,7 @@ def MakeFileAnnotated(fileobj):
try:
# Detect threads no longer existing.
indexes = (getattr(t, 'index', None) for t in threading.enumerate())
indexed = filter(None, indexes)
indexes = filter(None, indexes)
for index in new_fileobj.output_buffers:
if not index in indexes:
orphans.append((index, new_fileobj.output_buffers[index][0]))
@@ -480,7 +480,7 @@ def FindGclientRoot(from_dir, filename='.gclient'):
# might have failed. In that case, we cannot verify that the .gclient
# is the one we want to use. In order to not to cause too much trouble,
# just issue a warning and return the path anyway.
print >>sys.stderr, ("%s file in parent directory %s might not be the "
print >> sys.stderr, ("%s file in parent directory %s might not be the "
"file you want to use" % (filename, path))
return path
scope = {}