repopick: Clear Pyright warnings
Change-Id: I63962cc31820329a0fcf8ed96a13ef12a9f67875
diff --git a/build/tools/repopick.py b/build/tools/repopick.py
index 928ffb3..0a28d37 100755
--- a/build/tools/repopick.py
+++ b/build/tools/repopick.py
@@ -57,10 +57,10 @@
We have to get the data, then transform it to match what we're expecting from the HTTP RESET API
"""
if remote_url.count(":") == 2:
- (uri, userhost, port) = remote_url.split(":")
+ (_, userhost, port) = remote_url.split(":")
userhost = userhost[2:]
elif remote_url.count(":") == 1:
- (uri, userhost) = remote_url.split(":")
+ (_, userhost) = remote_url.split(":")
userhost = userhost[2:]
port = "29418"
else:
@@ -117,7 +117,7 @@
"status": data["status"],
}
reviews.append(review)
- except:
+ except Exception:
pass
return reviews
@@ -376,6 +376,8 @@
projects = xml_root.findall("project")
remotes = xml_root.findall("remote")
default_revision = xml_root.findall("default")[0].get("revision")
+ if not default_revision:
+ raise ValueError("Failed to get revision from manifest")
# dump project data into the a list of dicts with the following data:
# {project: {path, revision}}
@@ -534,11 +536,12 @@
item["revision"] = x
break
else:
- args.quiet or print(
- "ERROR: The patch set {0}/{1} could not be found, using CURRENT_REVISION instead.".format(
- change, patchset
+ if not args.quiet:
+ print(
+ "ERROR: The patch set {0}/{1} could not be found, using CURRENT_REVISION instead.".format(
+ change, patchset
+ )
)
- )
mergables[project_path].append(item)
@@ -665,7 +668,8 @@
def apply_change(args, item):
- args.quiet or print("Applying change number {0}...".format(item["id"]))
+ if not args.quiet:
+ print("Applying change number {0}...".format(item["id"]))
if is_closed(item["status"]):
print("!! Force-picking a closed change !!\n")