Revert "roomservice: Improve error handling on search"
This reverts commit db420bd88be9cf7cf7262a59214cf6d26c13ca8d.
Signed-off-by: noname55804 <marlin2201@gmail.com>
Conflicts:
tools/roomservice.py
Change-Id: I6591ec7fa9a313cfe8effc48378718a4927b2800
diff --git a/tools/roomservice.py b/tools/roomservice.py
index 2c5967e..ed8c325 100755
--- a/tools/roomservice.py
+++ b/tools/roomservice.py
@@ -72,15 +72,16 @@
if not depsonly:
githubreq = urllib.request.Request("https://api.github.com/search/repositories?q=%s+user:CyanHacker-Lollipop+in:name+fork:true" % device)
add_auth(githubreq)
+ result = json.loads(urllib.request.urlopen(githubreq).read().decode())
try:
- result = json.loads(urllib.request.urlopen(githubreq).read().decode())
- except urllib.error.URLError:
- print("Failed to search GitHub")
+ numresults = int(result['total_count'])
+ except:
+ print("Failed to search GitHub (offline?)")
sys.exit()
if (numresults == 0):
print("Could not find device %s on github.com/CyanHacker-Lollipop" % device)
sys.exit()
- for res in result.get('items', []):
+ for res in result['items']:
repositories.append(res)
local_manifests = r'.repo/local_manifests'