summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorOmer Katz <omer.drow@gmail.com>2018-12-31 20:30:50 +0200
committerOmer Katz <omer.drow@gmail.com>2019-01-03 17:51:28 +0200
commit9ff8083659dbfd8c955b027ccdd2c3f292d258bb (patch)
treeae0bc06188f2abf2e736dd489778ae121798a434
parenteded86487e8def549a961fd216b3048f6dd0f0f7 (diff)
downloadkombu-thedrow-patch-1.tar.gz
Avoid raising StopIterator in generators.thedrow-patch-1
According to [PEP-479](https://www.python.org/dev/peps/pep-0479/) StopIteration should not be used any more to indicate the termination of a generator. Starting from Python 3.7 this behaviour is always enforced and a RuntimeError is raised instead. We now return instead of raising StopIteration.
-rw-r--r--kombu/asynchronous/hub.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/kombu/asynchronous/hub.py b/kombu/asynchronous/hub.py
index 262aa703..1f3478a9 100644
--- a/kombu/asynchronous/hub.py
+++ b/kombu/asynchronous/hub.py
@@ -305,8 +305,8 @@ class Hub(object):
try:
events = poll(poll_timeout)
# print('[EVENTS]: %s' % (self.repr_events(events),))
- except ValueError: # Issue 882
- raise StopIteration()
+ except ValueError: # Issue celery/#882
+ return
for fd, event in events or ():
general_error = False