Use pylint 2.7 for depot_tools

This includes a few fixes for specific errors, and disables several new
warnings introduced in this version, in order to allow for an incremental migration.

Bug:1262286
Change-Id: Ie97d686748c9c952e87718a65f401c5f6f80a5c9
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/3400616
Reviewed-by: Gavin Mak <gavinmak@google.com>
Commit-Queue: Aravind Vasudevan <aravindvasudev@google.com>
diff --git a/git_cache.py b/git_cache.py
index f544c5a..d612c25 100755
--- a/git_cache.py
+++ b/git_cache.py
@@ -116,7 +116,7 @@
 
   def __init__(self, url, refs=None, commits=None, print_func=None):
     self.url = url
-    self.fetch_specs = set([self.parse_fetch_spec(ref) for ref in (refs or [])])
+    self.fetch_specs = {self.parse_fetch_spec(ref) for ref in (refs or [])}
     self.fetch_commits = set(commits or [])
     self.basedir = self.UrlToCacheDir(url)
     self.mirror_path = os.path.join(self.GetCachePath(), self.basedir)
@@ -576,8 +576,7 @@
     if not prev_dest_prefix:
       return
     for path in ls_out_set:
-      if (path == prev_dest_prefix + '/' or
-          path == prev_dest_prefix + '.ready'):
+      if path in (prev_dest_prefix + '/', prev_dest_prefix + '.ready'):
         continue
       if path.endswith('.ready'):
         gsutil.call('rm', path)