Skip to content

Commit

Permalink
Merge pull request #359 from jqueuniet/fix_empty_list_conversion
Browse files Browse the repository at this point in the history
Fix len() calls for empty RecordSet
  • Loading branch information
Zach Moody authored Apr 6, 2021
2 parents dfccaba + be0f0d4 commit 9f3f4a9
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion pynetbox/core/response.py
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,10 @@ def __len__(self):
try:
return self.request.count
except AttributeError:
self._response_cache.append(next(self.response))
try:
self._response_cache.append(next(self.response))
except StopIteration:
return 0
return self.request.count


Expand Down

0 comments on commit 9f3f4a9

Please sign in to comment.