Skip to content

Commit 11f6422

Browse files
committed
Fixed issue #23 raise of StopIterator due to bad error checking code.
1 parent d9f803a commit 11f6422

1 file changed

Lines changed: 11 additions & 0 deletions

File tree

pyral/rallyresp.py

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -238,6 +238,17 @@ def _item(self):
238238
def __iter__(self):
239239
return self
240240

241+
def __nonzero__(self):
242+
"""
243+
This is for evaluating any invalid response as False.
244+
245+
:return:
246+
"""
247+
if 200 <= self.status_code < 300:
248+
return True
249+
else:
250+
return False
251+
241252
def next(self):
242253
"""
243254
Return a hydrated instance from the self.page until the page is exhausted,

0 commit comments

Comments
 (0)