From 766e0b685d7d13adbcaa6e475c03b3ba96c196b2 Mon Sep 17 00:00:00 2001 From: Lance Stout Date: Fri, 22 Feb 2013 10:07:19 -0800 Subject: Clear out iterable data when resetting Disco items. --- sleekxmpp/plugins/xep_0030/stanza/items.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/sleekxmpp/plugins/xep_0030/stanza/items.py b/sleekxmpp/plugins/xep_0030/stanza/items.py index 512f2336..10458614 100644 --- a/sleekxmpp/plugins/xep_0030/stanza/items.py +++ b/sleekxmpp/plugins/xep_0030/stanza/items.py @@ -128,9 +128,10 @@ class DiscoItems(ElementBase): def del_items(self): """Remove all items.""" self._items = set() - for item in self['substanzas']: - if isinstance(item, DiscoItem): - self.xml.remove(item.xml) + items = [i for i in self.iterables if isinstance(i, DiscoItem)] + for item in items: + self.xml.remove(item.xml) + self.iterables.remove(item) class DiscoItem(ElementBase): -- cgit v1.2.3