Ticket #10753: dj.patch
File dj.patch, 1.2 KB (added by , 16 years ago) |
---|
-
django/dispatch/dispatcher.py
120 120 else: 121 121 lookup_key = (_make_id(receiver), _make_id(sender)) 122 122 123 for index in xrange(len(self.receivers)): 124 (r_key, _) = self.receivers[index] 125 if r_key == lookup_key: 126 del self.receivers[index] 123 self.receivers = filter(lambda value: value[0] != lookup_key, self.receivers) 127 124 128 125 def send(self, sender, **named): 129 126 """Send signal from sender to all connected receivers. … … 205 202 def _remove_receiver(self, receiver): 206 203 """Remove dead receivers from connections.""" 207 204 208 to_remove = [] 209 for key, connected_receiver in self.receivers: 210 if connected_receiver == receiver: 211 to_remove.append(key) 212 for key in to_remove: 213 for idx, (r_key, _) in enumerate(self.receivers): 214 if r_key == key: 215 del self.receivers[idx] 205 self.receivers = filter(lambda value: value[1] != receiver, self.receivers)