Skip to content
This repository was archived by the owner on Aug 7, 2024. It is now read-only.

Commit 9fb473e

Browse files
committed
fixes key error when reading JSON from ids v. list endpoints
1 parent f3a16fa commit 9fb473e

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

twitter/api.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1706,7 +1706,10 @@ def _GetBlocksMutesPaged(self,
17061706
resp = self._RequestUrl(url, 'GET', data=parameters)
17071707
data = self._ParseAndCheckTwitter(resp.content.decode('utf-8'))
17081708

1709-
result += [User.NewFromJsonDict(x) for x in data['users']]
1709+
if action == 'ids':
1710+
result += data.get('ids')
1711+
else:
1712+
result += [User.NewFromJsonDict(x) for x in data['users']]
17101713
next_cursor = data.get('next_cursor', 0)
17111714
previous_cursor = data.get('previous_cursor', 0)
17121715

0 commit comments

Comments
 (0)