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: I4b8f8fc521386419a3121bbb07edc8ac83170a94
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/3413679
Reviewed-by: Josip Sokcevic <sokcevic@google.com>
Commit-Queue: Aravind Vasudevan <aravindvasudev@google.com>
diff --git a/scm.py b/scm.py
index 39f8c58..8368bd0 100644
--- a/scm.py
+++ b/scm.py
@@ -71,23 +71,23 @@
"""
if os.path.isdir(os.path.join(root, '.git')):
return 'git'
- else:
- try:
- subprocess2.check_call(
- ['git', 'rev-parse', '--show-cdup'],
- stdout=subprocess2.DEVNULL,
- stderr=subprocess2.DEVNULL,
- cwd=root)
- return 'git'
- except (OSError, subprocess2.CalledProcessError):
- return None
+
+ try:
+ subprocess2.check_call(
+ ['git', 'rev-parse', '--show-cdup'],
+ stdout=subprocess2.DEVNULL,
+ stderr=subprocess2.DEVNULL,
+ cwd=root)
+ return 'git'
+ except (OSError, subprocess2.CalledProcessError):
+ return None
def only_int(val):
if val.isdigit():
return int(val)
- else:
- return 0
+
+ return 0
class GIT(object):
@@ -261,7 +261,8 @@
if 'origin/main' in remote_branches:
# Fall back on origin/main if it exits.
return 'origin', 'refs/heads/main'
- elif 'origin/master' in remote_branches:
+
+ if 'origin/master' in remote_branches:
# Fall back on origin/master if it exits.
return 'origin', 'refs/heads/master'