diff options
author | mathieui <mathieui@mathieui.net> | 2012-04-27 23:42:22 +0200 |
---|---|---|
committer | mathieui <mathieui@mathieui.net> | 2012-04-27 23:42:22 +0200 |
commit | 24341c84290b5e9636223fb9679efd6a7b52c5e2 (patch) | |
tree | 3e516358f7e12240cbd24b535c5721f32a1979b7 /src/roster.py | |
parent | de63a1affdb57f521ab2e7a3e89182c79c1ebe2f (diff) | |
download | poezio-24341c84290b5e9636223fb9679efd6a7b52c5e2.tar.gz poezio-24341c84290b5e9636223fb9679efd6a7b52c5e2.tar.bz2 poezio-24341c84290b5e9636223fb9679efd6a7b52c5e2.tar.xz poezio-24341c84290b5e9636223fb9679efd6a7b52c5e2.zip |
Prevent some iteration problems
Diffstat (limited to 'src/roster.py')
-rw-r--r-- | src/roster.py | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/roster.py b/src/roster.py index 957ed51a..5d21d829 100644 --- a/src/roster.py +++ b/src/roster.py @@ -242,7 +242,7 @@ class RosterGroup(object): return 5 return PRESENCE_PRIORITY[show] contact_list = self.contacts if not contact_filter\ - else (contact for contact in self.contacts if contact_filter[0](contact, contact_filter[1])) + else [contact for contact in self.contacts.copy() if contact_filter[0](contact, contact_filter[1])] return sorted(contact_list, key=compare_contact, reverse=True) def toggle_folded(self): @@ -250,7 +250,7 @@ class RosterGroup(object): def get_nb_connected_contacts(self): l = 0 - for contact in self.contacts: + for contact in self.contacts.copy(): if contact.resources: l += 1 return l |