Skip to content

Commit 6399326

Browse files
committed
Merge pull request #27 from ssbarnea/master
Fixed issue #23 raise of StopIterator due to bad error checking code.
2 parents 0e68805 + 11f6422 commit 6399326

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

pyral/rallyresp.py

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -241,6 +241,17 @@ def _item(self):
241241
def __iter__(self):
242242
return self
243243

244+
def __nonzero__(self):
245+
"""
246+
This is for evaluating any invalid response as False.
247+
248+
:return:
249+
"""
250+
if 200 <= self.status_code < 300:
251+
return True
252+
else:
253+
return False
254+
244255
def next(self):
245256
"""
246257
Return a hydrated instance from the self.page until the page is exhausted,

0 commit comments

Comments
 (0)