2to3 says we should use a for loop here

This commit is contained in:
Ask Solem 2010-12-02 15:24:35 +01:00
parent 97ac8b077c
commit eb7748d27b
2 changed files with 3 additions and 2 deletions

View File

@ -2,7 +2,7 @@
Example producer that sends a single message and exits.
You can use `demo_receive.py` to receive the message sent.
You can use `complete_receive.py` to receive the message sent.
"""

View File

@ -437,7 +437,8 @@ class Channel(AbstractChannel):
"""Close channel, cancel all consumers, and requeue unacked
messages."""
self.closed = True
map(self.basic_cancel, list(self._consumers))
for consumer in list(self._consumers):
self.basic_cancel(consumer)
self.qos.restore_unacked_once()
self.connection.close_channel(self)
self._cycle = None