File tree 1 file changed +9
-2
lines changed 1 file changed +9
-2
lines changed Original file line number Diff line number Diff line change @@ -40,15 +40,20 @@ async def query(self, generated_query: str) -> Dict:
40
40
r = await self .session .post ("https://api.github.com/graphql" ,
41
41
headers = headers ,
42
42
json = {"query" : generated_query })
43
- return await r .json ()
43
+ result = await r .json ()
44
+ if result is not None :
45
+ return result
44
46
except :
45
47
print ("aiohttp failed for GraphQL query" )
46
48
# Fall back on non-async requests
47
49
async with self .semaphore :
48
50
r = requests .post ("https://api.github.com/graphql" ,
49
51
headers = headers ,
50
52
json = {"query" : generated_query })
51
- return r .json ()
53
+ result = r .json ()
54
+ if result is not None :
55
+ return result
56
+ return dict ()
52
57
53
58
async def query_rest (self , path : str , params : Optional [Dict ] = None ) -> Dict :
54
59
"""
@@ -312,6 +317,8 @@ async def get_stats(self) -> None:
312
317
repos += contrib_repos .get ("nodes" , [])
313
318
314
319
for repo in repos :
320
+ if repo is None :
321
+ continue
315
322
name = repo .get ("nameWithOwner" )
316
323
if name in self ._repos or name in self ._exclude_repos :
317
324
continue
You can’t perform that action at this time.
0 commit comments